RL Parser API
The RL Parser API streamlines configuration management for decrypted logs, minimizing manual effort and enabling more consistent, scalable processes. It supports near real-time log decryption, enhancing automation and flexibility for customers managing configurations and logs.
With the RL Parser API, you can:
- Create RL Parsers with custom configurations, enabling automated parser creation within your environment.
- Delete RL Parsers by specifying a parser ID, allowing for automated cleanup of unused resources.
- Retrieve a list of all RL Parsers to efficiently manage and review configurations in bulk.
- Update specific RL Parser configurations, enabling programmatic modifications as needs evolve.
The following documentation provides detailed explanations for each of the cURL commands used to create, retrieve, edit, and delete an RL Parser by way of the API.
Create RL Parser
cURL Command:
curl --location "${BASE_URL}/rlparsers" \
--header 'content-type: application/json' \
--data '{
"parser": {
"name":"demo1",
"host": "12.80.41.132",
"port": 62616
}
}'
Explanation:
This cURL command is used to create a new RL Parser with specific configuration data.
- Method: POST (implicitly, because of
--data
flag)
-
URL:
$\{BASE_URL\}/rlparsers
$\{BASE_URL\}
: A variable representing the base URL of the API endpoint. Replace it with the actual URL when running the command./rlparsers
: The endpoint for creating an RL parser.
-
Headers:
content-type: application/json
: Indicates that the body of the request contains JSON data.
-
Data: The body of the request contains a JSON object that defines the properties of the RL parser being created:
- parser: A JSON object containing the configuration for the parser:
name
: The name of the parser (in this case, "demo1").host
: The IP address (in this case, "12.80.41.132") where the RL parser will run.port
: The port number (in this case, "62616") that the parser will listen on.
- parser: A JSON object containing the configuration for the parser:
Response:
Upon successful execution, the server should respond with a status message confirming the parser creation, often including the created parser's details or an ID.
Get RL Parser
cURL Command:
curl --location "${BASE_URL}/rlparsers" \
--header 'content-type: application/json' \
--data '{
"parser": {
"name":"demo1",
"host": "12.80.41.132",
"port": 62616
}
}'
Explanation:
This cURL command retrieves the details of an existing RL parser.
- Method: GET
-
URL:
$\{BASE_URL\}/rlparsers
$\{BASE_URL\}
: Replace this with the actual base URL of the API./rlparsers
: The endpoint to retrieve RL parser information.
-
Headers:
content-type: application/json
: This header informs the server that the client expects a JSON response.
Response:
The server will respond with a list or object containing the details of the available RL parsers. It will typically include information such as parser names, IDs, host, port, and any other configurations associated with the parsers.
Edit RL Parser
cURL Command:
curl --location "${BASE_URL}/rlparsers/${RLPARSERS_ID}" \
--request PUT \
--header 'content-type: application/json' \
--data '{
"parser": {
"name":"demo2",
"host": "12.80.41.132",
"port": 62616
}
}'
Explanation:
This cURL command retrieves the configuration details of a specific RL parser that can be edited. It is assumed that you would send an updated payload in a subsequent request (not shown in this command, but implied).
- Method: PUT
-
URL:
$\{BASE_URL\}/rlparsers/$\{RL_PARSER_ID\}
$\{BASE_URL\}
: The base URL of the API./rlparsers/$\{RL_PARSER_ID\}
: The endpoint to update a specific parser.$\{RL_PARSER_ID\}
should be replaced with the actual ID of the parser you want to update. This ID is usually returned when creating a parser.
-
Headers:
content-type: application/json
: This header informs the server that the client expects the response in JSON format.
Response:
The response will typically contain the current configuration of the parser specified by $\{RL_PARSER_ID\}
, including details such as the name, host, port, and any other parameters associated with the parser.
Start RL Parser
cURL Command:
curl --location "${BASE_URL}/rlparsers/${RLPARSERS_ID}" \
--request PUT \
--header 'content-type: application/json' \
--data '{
"parser": {
"name":"demo2",
"host": "12.80.41.132",
"port": 62616
}
}'
The Start command functions similarly to the Edit cURL command but includes an additional parameter called status, which when specified, starts the RL Parser.
Explanation:
This cURL command with a status of 180 will start the RL Parser.
- Method: PUT
-
URL:
$\{BASE_URL\}/rlparsers/$\{RL_PARSER_ID\}
$\{BASE_URL\}
: The base URL of the API./rlparsers/$\{RL_PARSER_ID\}
: The endpoint to update a specific parser.$\{RL_PARSER_ID\}
should be replaced with the actual ID of the parser you want to update. This ID is usually returned when creating a parser.
-
Headers:
content-type: application/json
: This header informs the server that the client expects the response in JSON format.
Response:
The response will typically contain the current configuration of the parser specified by $\{RL_PARSER_ID\}
, including details such as the name, host, port, and any other parameters associated with the parser.
Stop RL Parser
cURL Command:
curl --location "${BASE_URL}/rlparsers/${RLPARSERS_ID}" \
--request PUT \
--header 'content-type: application/json' \
--data '{
"parser": {
"name":"demo2",
"host": "12.80.41.132",
"port": 62616
}
}'
The Stop command functions similarly to the Edit cURL command but includes an additional parameter called status, which when specified, stops the RL Parser.
Explanation:
This cURL command with a status of 100 will stop the RL Parser.
- Method: PUT
-
URL:
$\{BASE_URL\}/rlparsers/$\{RL_PARSER_ID\}
$\{BASE_URL\}
: The base URL of the API./rlparsers/$\{RL_PARSER_ID\}
: The endpoint to update a specific parser.$\{RL_PARSER_ID\}
should be replaced with the actual ID of the parser you want to update. This ID is usually returned when creating a parser.
-
Headers:
content-type: application/json
: This header informs the server that the client expects the response in JSON format.
Response:
The response will typically contain the current configuration of the parser specified by $\{RL_PARSER_ID\}
, including details such as the name, host, port, and any other parameters associated with the parser.
Delete RL Parser
cURL Command:
curl --location "${BASE_URL}/rlparsers/{RLPARSERS_ID}" \
--request DELETE \
--header 'content-type: application/json'
Explanation:
This cURL command is used to delete an RL parser. The endpoint here indicates the deletion of an parser, but it's important to note that the specific parser to be deleted should be identified by an ID or other distinguishing factor.
- Method: DELETE
-
URL:
$\{BASE_URL\}/rlparsers/$\{RL_PARSER_ID\}
$\{BASE_URL\}
: The base URL of the API./rlparsers/$\{RL_PARSER_ID\}
: The endpoint to update a specific parser.$\{RL_PARSER_ID\}
should be replaced with the actual ID of the parser you want to update. This ID is usually returned when creating a parser.
Headers: content-type: application/json
: This header tells the server that the request is in JSON format.
Response:
The server will usually return a status message confirming the deletion of the parser, or an error message if the deletion was unsuccessful.
General Notes:
- BASE_URL: The variable
${BASE_URL}
should be replaced with the actual URL where the API is hosted. This might be something likehttp://localhost:8888/flexnet/pub-api/v1 or http://0.0.0.0:8888/flexnet/pub-api/v1
. - RL_PARSER_ID: When editing or deleting a specific parser, you need to replace
${RL_PARSER_ID}
with the actual ID of the parser, which may be returned in the response when the parser is created or listed. - Authentication: Depending on the API configuration, you may need to add authentication tokens or credentials to your headers, though this is not included in the examples above.
- Response Formats: The server responses for each operation will vary. Typically, they will be in JSON format, containing either the result of the operation (e.g., success or failure) or the requested data (e.g., parser details).