Summary

The testFdrFeed() mutation tests a Falcon Data Replicator (FDR) feed configuration. It verifies that LogScale can authenticate and reach the required AWS resources. Run it before enabling a feed to confirm credentials and connection settings are valid. Provide a feed ID to test an existing feed. Or supply AWS connection details directly to validate new settings. The test does not consume data from the queue.

Syntax

graphql
testFdrFeed(
      input: TestFdrFeed!
   ): TestFdrResult!

The mutation accepts a required input argument of type TestFdrFeed!. It specifies a repository name, an optional feed ID, and optional AWS connection fields.

Input parameters

Provide the target repository name and either a feedId or the individual AWS connection fields. When provided, feedId must identify an existing feed in the repository. Missing connection fields are resolved from the saved configuration. When you omit feedId, supply all connection fields directly. Use the same values as createFdrFeed().

Table: TestFdrFeed Input Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
clientIdString    AWS client id to use in FDR feed test. If not set, the 'clientId' of the existing FDR feed will be used.
clientSecretString    AWS client secret to use in FDR feed test. If not set, the 'clientSecret' of the existing FDR feed will be used.
feedIdString    Id of an existing FDR feed. If no id is provided, the remaining input fields must be set.
repositoryNameStringyes   Name of the repository of the FDR feed.
s3IdentifierString    AWS S3 identifier to use in FDR feed test. If not set, the 's3Identifier' of the existing FDR feed will be used.
sqsUrlString    AWS SQS queue url to use in FDR feed test. If not set, the 'sqsUrl' of the existing FDR feed will be used.

Example

Raw
graphql
mutation {
  testFdrFeed(input: {repositoryName: "humio", feedId: "abc123"}) {
    ... on TestFdrSuccessResult {
      result
    }
    ... on TestFdrErrorResult {
      errors {
        __typename
        ... on TestFdrValidationError {
          fieldName
          message
        }
        ... on TestFdrRequestError {
          resourceName
          message
        }
      }
    }
  }
}
Mac OS or Linux (curl)
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  testFdrFeed(input: {repositoryName: \"humio\", feedId: \"abc123\"}) {
    ... on TestFdrSuccessResult {
      result
    }
    ... on TestFdrErrorResult {
      errors {
        __typename
        ... on TestFdrValidationError {
          fieldName
          message
        }
        ... on TestFdrRequestError {
          resourceName
          message
        }
      }
    }
  }
}"
}
EOF
Mac OS or Linux (curl) One-line
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  testFdrFeed(input: {repositoryName: \"humio\", feedId: \"abc123\"}) {
    ... on TestFdrSuccessResult {
      result
    }
    ... on TestFdrErrorResult {
      errors {
        __typename
        ... on TestFdrValidationError {
          fieldName
          message
        }
        ... on TestFdrRequestError {
          resourceName
          message
        }
      }
    }
  }
}"
}
EOF
Windows Cmd and curl
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json" ^
    -d @'{"query" : "mutation { ^
  testFdrFeed(input: {repositoryName: \"humio\", feedId: \"abc123\"}) { ^
    ... on TestFdrSuccessResult { ^
      result ^
    } ^
    ... on TestFdrErrorResult { ^
      errors { ^
        __typename ^
        ... on TestFdrValidationError { ^
          fieldName ^
          message ^
        } ^
        ... on TestFdrRequestError { ^
          resourceName ^
          message ^
        } ^
      } ^
    } ^
  } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  testFdrFeed(input: {repositoryName: \"humio\", feedId: \"abc123\"}) {
    ... on TestFdrSuccessResult {
      result
    }
    ... on TestFdrErrorResult {
      errors {
        __typename
        ... on TestFdrValidationError {
          fieldName
          message
        }
        ... on TestFdrRequestError {
          resourceName
          message
        }
      }
    }
  }
}"
}'
    "$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $query = "mutation {
  testFdrFeed(input: {repositoryName: \"humio\", feedId: \"abc123\"}) {
    ... on TestFdrSuccessResult {
      result
    }
    ... on TestFdrErrorResult {
      errors {
        __typename
        ... on TestFdrValidationError {
          fieldName
          message
        }
        ... on TestFdrRequestError {
          resourceName
          message
        }
      }
    }
  }
}";
$query =~ s/\n/ /g;
my $json = sprintf('{"query" : "%s"}',$query);
my $req = HTTP::Request->new("POST", $uri );

$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");

$req->content( $json );

my $lwp = LWP::UserAgent->new;

my $result = $lwp->request( $req );

print $result->{"_content"},"\n";
Python
python
#! /usr/local/bin/python3

import requests

url = '$YOUR_LOGSCALE_URL/graphql'
mydata = r'''{"query" : "mutation {
  testFdrFeed(input: {repositoryName: \"humio\", feedId: \"abc123\"}) {
    ... on TestFdrSuccessResult {
      result
    }
    ... on TestFdrErrorResult {
      errors {
        __typename
        ... on TestFdrValidationError {
          fieldName
          message
        }
        ... on TestFdrRequestError {
          resourceName
          message
        }
      }
    }
  }
}"
}'''

resp = requests.post(url,
                     data = mydata,
                     headers = {
   "Authorization" : "Bearer $TOKEN",
   "Content-Type" : "application/json"
}
)

print(resp.text)
Node.js
javascript
const https = require('https');

const data = JSON.stringify(
    {"query" : "mutation {
  testFdrFeed(input: {repositoryName: \"humio\", feedId: \"abc123\"}) {
    ... on TestFdrSuccessResult {
      result
    }
    ... on TestFdrErrorResult {
      errors {
        __typename
        ... on TestFdrValidationError {
          fieldName
          message
        }
        ... on TestFdrRequestError {
          resourceName
          message
        }
      }
    }
  }
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL',
  path: 'graphql',
  port: 443,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length,
    Authorization: 'BEARER ' + process.env.TOKEN,
    'User-Agent': 'Node',
  },
};

const req = https.request(options, (res) => {
  let data = '';
  console.log(`statusCode: ${res.statusCode}`);

  res.on('data', (d) => {
    data += d;
  });
  res.on('end', () => {
    console.log(JSON.parse(data).data);
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.write(data);
req.end();

Returned values

The returned type, TestFdrResult, is a union of TestFdrSuccessResult and TestFdrErrorResult. TestFdrSuccessResult carries a single result field confirming successful connectivity. TestFdrErrorResult carries an errors list. Each member is TestFdrValidationError or TestFdrRequestError. TestFdrValidationError names the invalid fieldName and includes a message. TestFdrRequestError identifies the unreachable AWS resourceName and includes a message. Include fields for both union types in your query. The response includes whichever type the test returns.

Table: TestFdrSuccessResult Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
resultBooleanyes Long-Term This field is always 'true'

Table: TestFdrErrorResult Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
errorserroryes Long-Term List of test errors.