Skip to main content

Traffic sources

List all traffic sources

Request

Definition

GET /api/v1/settings/firewalls

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}

Response

Status codes

Status codeMessage
200"List of traffic sources"
403"Forbidden"

Body

  • data.traffic_sources.address string

    IP address on which the traffic source is active.

  • data.traffic_sources.date_format string

    Indicates the date format of the logs.

  • data.traffic_sources.description string

    Traffic source description.

  • data.traffic_sources.enabled boolean

    Indicates whether the traffic source is enabled.

  • data.traffic_sources.http_source_timezone string

    Timezone associated with the traffic source.

  • data.traffic_sources.log_format string

    Log format.

  • data.traffic_sources.name string

    Traffic source name.

  • data.traffic_sources.port integer

    Port on which the traffic source is listening.

  • data.traffic_sources.rule_match_format string

    ...

  • data.traffic_sources.time_format string

    Indicates the format in which the date of the logs should be displayed.

  • data.traffic_sources.timestamp_format string

    Log timestamp format.

  • data.traffic_sources.type string

    Indicates the traffic sorce type.

  • data.traffic_sources.unix_timestamps boolean

    If true, it indicates that the timestamp format is UNIX.

List a specific traffic source

Request

Definition

GET /api/v1/settings/traffic_sources/{traffic_source_name}

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}

Response

Status codes

Status codeMessage
200"Traffic source retrieved"
400"Error retrieving traffic source"
403"Forbidden"

Body

{
"data": {
"traffic_source": {
"address": "10.99.99.199",
"date_format": null,
"description": "test description nginx",
"enabled": true,
"http_source_timezone": null,
"log_format": null,
"name": "test_nginx_2",
"port": 20052,
"rule_match_format": null,
"time_format": null,
"timestamp_format": null,
"type": "nginx_log",
"unix_timestamps": false
}
},
"message": "Traffic source retrieved",
"status": "ok"
}

Create a traffic source

Request

Definition

POST /api/v1/settings/traffic_sorces

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}
  • Content-Type required

    application/json

Request body

{
"traffic_source": {
"address": "10.99.99.196",
"date_format": "%Y-%m-%d",
"description": "description test_api_insert",
"enabled": true,
"http_source_timezone": "-01:00",
"log_format": "client_address=%client_address date=%date time=%time",
"name": "test_api_insert_2",
"time_format": "%H:%M:%S",
"type": "custom_log"
}
}

Response

Status codes

Status codeMessage
200"Traffic source creation submitted"
400"Error creating traffic source"
403"Forbidden"

Body

{
"data": {
"traffic_source": {
"address": "10.99.99.196",
"date_format": "%Y-%m-%d",
"description": "description test_api_insert",
"enabled": true,
"http_source_timezone": "-01:00",
"log_format": "client_address=%client_address date=%date time=%time",
"name": "test_api_insert_2",
"port": 20053,
"rule_match_format": null,
"time_format": "%H:%M:%S",
"timestamp_format": null,
"type": "custom_log",
"unix_timestamps": null
}
},
"message": "Traffic source creation submitted",
"status": "ok"
}

Update a traffic source

Request

Definition

PUT /api/v1/settings/traffic_sources/{traffic_source_name}

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}
  • Content-Type required

    application/json

Request body

{
"attrs": {
"address": "10.87.86.85",
"date_format": "YYYY_MM_dd",
"http_source_timezone": "GMT+03:08",
"time_format": "HH_mm_ss.sss"
}
}

Response

Status codes

Status codeMessage
200"Traffic source modified"
400"Error updating traffic source"
403"Forbidden"

Body

{
"data": {
"traffic_source": {
"address": "10.87.86.85",
"date_format": "YYYY_MM_dd",
"description": "test desciption custom ts",
"enabled": false,
"http_source_timezone": "GMT+03:08",
"log_format": "client_address=%client_address timestamp=%timestamp",
"name": "test_custom_ts_2",
"port": 20051,
"rule_match_format": null,
"time_format": "HH_mm_ss.sss",
"timestamp_format": "%Y-%m-%dT%H:%M:%S",
"type": "custom_log",
"unix_timestamps": null
}
},
"message": "Traffic source modified",
"status": "ok"
}

Delete a traffic source

Request

Definition

DELETE /api/v1/settings/traffic_sources/{traffic_source_name}

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}
  • Content-Type required

    application/json

Response

Status codes

Status codeMessage
200"Traffic source deleted"
400"Error deleting traffic source"
403"Forbidden"

Body

{
"data": {
"traffic_source": {
"address": null,
"date_format": null,
"description": null,
"enabled": null,
"http_source_timezone": null,
"log_format": null,
"name": "test_api_insert_2",
"port": null,
"rule_match_format": null,
"time_format": null,
"timestamp_format": null,
"type": null,
"unix_timestamps": null
}
},
"message": "Traffic source deleted",
"status": "ok"
}