Template services
addmastertemplate
Creates a master configuration template which can be applied to agents.
Type of Request: POST
URL: https://hostname:9443/nxlog-manager/mvc/restservice/addmastertemplate
Parameters are listed below.
Parameter | Description | Format | Type |
---|---|---|---|
|
Object containing all configuration parameters of the template being created.
It specifies the |
XML or JSON object |
Required |
|
The unique name for the template. |
String |
Required |
|
The arbitrary description of the template. |
String |
Optional |
|
Object with several nested configuration parameters which are listed in the rows below. The first three parameters are required and define the minimum configuration of the template, and others are optional. |
XML or JSON object |
Required |
|
Fingerprint of the certificate authority which was used for issuing the Manager server certificate. To obtain information about the fingerprint, you can run the certificateinfo service. |
String |
Required |
|
Communication address or DNS hostname of the agent in case of the IPv4 and IPv6 addresses are supported. |
String |
Required |
|
Port associated with the |
Integer |
Required |
|
Specifies the Log to file
parameter configuration. The default value is |
Boolean |
Optional |
|
Severity level as per the LogLevel directive.
Accepts one of the following values: |
String |
Optional |
|
The connection mode the agent will use after creation.
Accepts the For more details, see the Connection Type parameter description of the Agent Configuration topic. |
String |
Optional |
|
Verbatim configuration of the agents, which is available in the Verbatim config field of the NXLog Manager user interface. |
String |
Optional |
curl -k -v POST "https://hostname:9443/nxlog-manager/mvc/restservice/addmastertemplate" -H "accept:application/json" -H "REST_PASSWORD: nxlog123" -H "REST_USER: admin" -H "Content-Type: application/json" -d "{ \"description\":\"The template description\",\"global-config\": { \"ca-fingerprint\":\"eeba4ac8654e0ec7e52ad8732f56c5c879c217\", \"address\": \"192.168.31.80\", \"port\": 9442,\"is-log-to-file\":true, \"log-level\":\"INFO\", \"verbatim\":\"<Input from_null>\nModule im_null\n</Input>\n\n<Output to_null>\nModule om_null\n</Output>\n\n<Route r1>\nPath from_null => to_null\n</Route>\", \"mode\": \"Listen\" }, \"name\": \"Agent_mastertemplate\"}"
{
"servicename" : "addmastertemplate",
"values" : [ {
"message" : "Template 'Agent_mastertemplate' is created."
} ],
"links" : [ {
"rel" : "self",
"href" : "https://hostname:9443/nxlog-manager/mvc/mvc/restservice/viewagentortemplate?name=Agent_mastertemplate"
} ]
}
addsubtemplate
Creates an auxiliary configuration template which can be applied in addition to a master template.
Type of Request: POST
URL: https://hostname:9443/nxlog-manager/mvc/restservice/addsubtemplate
Parameters are listed below.
Parameter | Description | Format | Type |
---|---|---|---|
|
Object containing all configuration parameters of the template being created.
It specifies the |
XML or JSON object |
Required |
|
The unique name for the template. |
String |
Required |
|
The arbitrary description of the template. |
String |
Optional |
|
Object containing the |
XML or JSON object |
Optional |
|
Verbatim configuration available in the Verbatim config field of the NXLog Manager user interface. |
String |
Optional |
curl -k -v POST "https://hostname:9443/nxlog-manager/mvc/restservice/addsubtemplate" -H "accept:application/json" -H "REST_PASSWORD: nxlog123" -H "REST_USER: admin" -H "Content-Type: application/json" -d "{ \"description\":\"the subtemplate_one\",\"global-config\": { \"verbatim\":\"<Extension json>\nModule xm_json\n</Extension>\" }, \"name\": \"Agent_subtemplate\"}"
{
"servicename" : "addsubtemplate",
"values" : [ {
"message" : "Template 'Agent_subtemplate' is created."
} ],
"links" : [ {
"rel" : "self",
"href" : "https://hostname:9443/nxlog-manager/mvc/mvc/restservice/viewagentortemplate?name=Agent_subtemplate"
} ]
}
modifymastertemplate
Modifies the existing master template which had already been created using the [addmastertemplate].
Type of Request: PUT
URL: https://hostname:9443/nxlog-manager/mvc/restservice/modifymastertemplate
Parameters are listed below.
Parameter | Description | Format | Type |
---|---|---|---|
|
Name of the master template to be modified. |
String |
Required |
|
Object with the description of all modifications to be done over the
template. It specifies the |
XML or JSON object |
Required |
|
The unique template name which will be used after modification. |
String |
Required |
|
The description which will be applied after the template modification. |
String |
Optional |
|
Object with several nested configuration parameters which are listed below in this table. The first three parameters are required and define the minimum configuration after modification, and others are optional. |
XML or JSON object |
Required |
|
Fingerprint of the certificate authority which was used for issuing the Manager server certificate. To obtain information about the fingerprint, you can run the certificateinfo service. |
String |
Required |
|
Communication address or DNS hostname of the agent in case of the IPv4 and IPv6 addresses are supported. |
String |
Required |
|
Port associated with the |
Integer |
Required |
|
Specifies the Log to file
parameter configuration. The default value is |
Boolean |
Optional |
|
Severity level as per the LogLevel directive.
Accepts one of the following values: |
String |
Optional |
|
The connection mode the agent will use after creation.
Accepts the For more details, see the Connection type parameter description of the Agent Configuration topic. |
String |
Optional |
|
Verbatim configuration of the agents, which is available in the Verbatim config field of the NXLog Manager user interface. |
String |
Optional |
curl -k -v -X PUT "https://127.0.0.1:9443/nxlog-manager/mvc/restservice/modifymastertemplate?masterTemplateName=Agent_mastertemplate" -H "accept:application/json" -H "REST_PASSWORD: nxlog123" -H "REST_USER: admin" -H "Content-Type: application/json" -d "{ \"description\":\"the template\",\"global-config\": { \"ca-fingerprint\":\"eeba4ac8654e0ec7e52ad8732f56c5c879c217\", \"address\": \"192.168.31.85\", \"port\": 9440,\"is-log-to-file\":false, \"log-level\":\"INFO\", \"verbatim\":\"<Input 1>Module im_internal</Input><Output 2>Module om_null</Output><Route r1>Path 1 => 2</Route>\", \"mode\": \"Listen\" }, \"name\": \"Agent_mastertemplate_modified\"}"
{
"servicename" : "modifymastertemplate",
"values" : [ {
"message" : "Template global configuration saved successfully."
} ],
"links" : [ {
"rel" : "self",
"href" : "https://hostname:9443/nxlog-manager/mvc/mvc/restservice/viewagentortemplate?name=Agent_mastertemplate_modified"
} ]
}
modifysubtemplate
Modifies the existing auxiliary template which had already been created using the addsubtemplate.
To work properly, configuration of the master and auxiliary templates must diverge. For more details, see the Planning section of the [Templates] topic. |
Type of Request: PUT
URL: https://hostname:9443/nxlog-manager/mvc/restservice/modifysubtemplate
Parameters are listed below.
Parameter | Description | Format | Type |
---|---|---|---|
|
Name of the template to be modified. |
String |
Required |
|
Object with the description of all modifications to be done over the
template. It specifies the |
XML or JSON object |
Required |
|
The unique name which will be assigned to the template after modification. |
String |
Required |
|
The description which will be applied after the template modification. |
String |
Optional |
|
Object containing the |
XML or JSON object |
Optional |
|
Verbatim configuration available in the Verbatim config field of the NXLog Manager user interface. |
String |
Optional |
curl -k -v -X PUT "https://hostname:9443/nxlog-manager/mvc/restservice/modifysubtemplate?subTemplateName=Agent_subtemplate" -H "accept:application/json" -H "REST_PASSWORD: nxlog123" -H "REST_USER: admin" -H "Content-Type: application/json" -d "{ \"description\":\"The Agent_subtemplate modified description\",\"global-config\": { \"verbatim\":\"<Extension syslog>\nModule xm_syslog\n</Extension>\" }, \"name\": \"Agent_subtemplate_modified\"}"
{
"servicename" : "modifysubtemplate",
"values" : [ {
"message" : "Template global configuration saved successfully."
} ],
"links" : [ {
"rel" : "self",
"href" : "https://hostname:9443/nxlog-manager/mvc/mvc/restservice/viewagentortemplate?name=Agent_subtemplate_modified"
} ]
}