Summary

The updateIngestListenerV3() mutation modifies the configuration of an existing ingest listener in a LogScale repository. After initial creation, change the listener's name, port, protocol, parser, bind interface, character set, or virtual host. To create an ingest listener, use createIngestListenerV3(). To remove one, use deleteIngestListener().

Syntax

graphql
updateIngestListenerV3(
      input: UpdateIngestListenerV3Input!
   ): IngestListener!

The mutation takes a single required input argument of type UpdateIngestListenerV3Input!. Provide the ingest listener id and repositoryName. Supply all configuration fields: name, port, protocol, bindInterface, parser, and charset. Run the repository() query to retrieve listener identifiers. The mutation returns a non-null IngestListener! object reflecting the updated state.

Input parameters

Provide the id of the ingest listener to update and the repositoryName that owns it. All other configuration fields must also be supplied. This mutation performs a full replacement of the listener configuration, not a partial update. Run the repository() query to retrieve listener identifiers before calling this mutation.

Table: UpdateIngestListenerV3Input Input Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
bindInterfaceStringyes Long-Term The IP address on which the ingest listener will bind.
charsetStringyes Long-Term The character set used to decode the event stream.
idStringyes Long-Term The unique identifier of the ingest listener.
nameStringyes Long-Term The name of the ingest listener.
parserStringyes Long-Term The unique identifier or name of the parser to assign to the ingest listener. Parsers in packages can be referred to as packagescope/packagename:parsername.
portIntyes Long-Term The port on which the ingest listener will listen.
protocolIngestListenerProtocolyes Long-Term The kind of listener. See IngestListenerProtocol.
repositoryNameStringyes Long-Term The name of the repository.
vHostInt  Long-Term The vHost name for the ingest listener.

Example

Raw
graphql
mutation {
  updateIngestListenerV3( input:
     { repositoryName: "humio",
       id: "abc123",
       name: "werelistening",
       port: 8080,
       protocol: TCP,
       bindInterface: "0.0.0.0",
       parser: "kv",
       charset: "UTF-8"
     } 
  )
  { id }
}
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 {
  updateIngestListenerV3( input:
     { repositoryName: \"humio\",
       id: \"abc123\",
       name: \"werelistening\",
       port: 8080,
       protocol: TCP,
       bindInterface: \"0.0.0.0\",
       parser: \"kv\",
       charset: \"UTF-8\"
     } 
  )
  { id }
}"
}
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 {
  updateIngestListenerV3( input:
     { repositoryName: \"humio\",
       id: \"abc123\",
       name: \"werelistening\",
       port: 8080,
       protocol: TCP,
       bindInterface: \"0.0.0.0\",
       parser: \"kv\",
       charset: \"UTF-8\"
     } 
  )
  { id }
}"
}
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 { ^
  updateIngestListenerV3( input: ^
     { repositoryName: \"humio\", ^
       id: \"abc123\", ^
       name: \"werelistening\", ^
       port: 8080, ^
       protocol: TCP, ^
       bindInterface: \"0.0.0.0\", ^
       parser: \"kv\", ^
       charset: \"UTF-8\" ^
     }  ^
  ) ^
  { id } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  updateIngestListenerV3( input:
     { repositoryName: \"humio\",
       id: \"abc123\",
       name: \"werelistening\",
       port: 8080,
       protocol: TCP,
       bindInterface: \"0.0.0.0\",
       parser: \"kv\",
       charset: \"UTF-8\"
     } 
  )
  { id }
}"
}'
    "$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 {
  updateIngestListenerV3( input:
     { repositoryName: \"humio\",
       id: \"abc123\",
       name: \"werelistening\",
       port: 8080,
       protocol: TCP,
       bindInterface: \"0.0.0.0\",
       parser: \"kv\",
       charset: \"UTF-8\"
     } 
  )
  { id }
}";
$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 {
  updateIngestListenerV3( input:
     { repositoryName: \"humio\",
       id: \"abc123\",
       name: \"werelistening\",
       port: 8080,
       protocol: TCP,
       bindInterface: \"0.0.0.0\",
       parser: \"kv\",
       charset: \"UTF-8\"
     } 
  )
  { id }
}"
}'''

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 {
  updateIngestListenerV3( input:
     { repositoryName: \"humio\",
       id: \"abc123\",
       name: \"werelistening\",
       port: 8080,
       protocol: TCP,
       bindInterface: \"0.0.0.0\",
       parser: \"kv\",
       charset: \"UTF-8\"
     } 
  )
  { id }
}"
}
);


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();
Example Responses
Success (HTTP Response Code 200 OK)
json
{
  "data": {
    "updateIngestListenerV3": {
      "id": "abc123"
    }
  }
}

Returned values

The mutation returns the updated IngestListener! object. Returned fields include the listener's identifier, name, port, and protocol. Additional fields include bind interface, character set, virtual host, associated repository, and assigned parser. Confirm that the returned values reflect the expected configuration.

Table: IngestListener Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
bindInterfaceStringyes Long-Term The ip address this listener will bind to. By default (leaving this field empty) it will bind to 0.0.0.0 - all interfaces. Using this field it is also possible to specify the address to bind to. In a cluster setup it is also possible to specify if only one machine should open a socket - The vhost field is used for that.
charsetStringyes Long-Term The character set used to decode the event stream. Available character sets depend on the JVM running the LogScale instance. Names and aliases can be found at http://www.iana.org/assignments/character-sets/character-sets.xhtml
idStringyes Long-Term The unique identifier for the ingest listener.
nameStringyes Long-Term The name of the ingest listener.
parserParser  Long-Term The parser configured to parse data for the listener. It returns null if the parser has been removed since the listener was created. See Parser.
portIntyes Long-Term The TCP/UDP port on which to listen.
protocolIngestListenerProtocolyes Long-Term The network protocol data is sent through. See IngestListenerProtocol.
repositoryRepositoryyes Long-Term The repository associated with the ingest listener. See Repository.
vHostInt  Long-Term Specify which host should open the socket. By default this field is empty and all hosts will open a socket. This field can be used to select only one host to open the socket.