Analytics Security Facede version v1
{schema}://{host}/api/{version}
- schema: required(one of http, https - default: http)
- host: required(string - default: localhost)
- version: required(v1)
Pipeline
Operations on pipelines.
Create or update existing ingest pipeline.
Retrieves pipeline by ID.
Deletes pipeline by ID.
put /_ingest/pipeline/{pipelineID}
Create or update existing ingest pipeline.
- application:update
Analytics Security Facede supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- pipelineID: required(string)
Pipeline ID.
Example:
application-bspu4tiikfmmfgrk47jg
Body
Media type: application/json
Type: asf-api-types.IngestPipelineRequest
Example:
{
"processors": [
{
"set": {
"if": "ctx.dataSample.tp > 30",
"field": "dataSample.temperatureLevel",
"value": "HIGH"
}
},
{
"set": {
"if": "ctx.dataSample.tp >= 0",
"field": "dataSample.temperatureLevel",
"value": "NORMAL"
}
},
{
"set": {
"if": "ctx.dataSample.tp < 0",
"field": "dataSample.temperatureLevel",
"value": "LOW"
}
},
{
"script": {
"lang": "painless",
"source": "ctx['dataSample']['computedValue'] = Math.log(ctx['dataSample']['ozone_sensor'] * 2) + ctx['dataSample']['PM_2_sensor'];"
}
}
]
}
HTTP status code 200
Pipeline is successfully created.
Body
Media type: application/json
Type: asf-api-types.Acknowledged
Example:
{
"acknowledged": true
}
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /_ingest/pipeline/{pipelineID}
Retrieves pipeline by ID.
- application:read
Analytics Security Facede supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- pipelineID: required(string)
Pipeline ID.
Example:
application-bspu4tiikfmmfgrk47jg
HTTP status code 200
Pipeline is successfully retrieved.
Body
Media type: application/json
Type: asf-api-types.IngestPipelineResponse
Example:
{
"e02e0679-2de5-48af-a2f0-c650356dc739-application-bspu4tiikfmmfgrk47jg": {
"processors": [
{
"set": {
"if": "ctx.dataSample.tp > 30",
"field": "dataSample.temperatureLevel",
"value": "HIGH"
}
},
{
"set": {
"if": "ctx.dataSample.tp >= 0",
"field": "dataSample.temperatureLevel",
"value": "NORMAL"
}
},
{
"set": {
"if": "ctx.dataSample.tp < 0",
"field": "dataSample.temperatureLevel",
"value": "LOW"
}
},
{
"script": {
"lang": "painless",
"source": "ctx['dataSample']['computedValue'] = Math.log(ctx['dataSample']['ozone_sensor'] * 2) + ctx['dataSample']['PM_2_sensor'];"
}
}
]
}
}
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /_ingest/pipeline/{pipelineID}
Deletes pipeline by ID.
- application:delete
Analytics Security Facede supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- pipelineID: required(string)
Pipeline ID.
Example:
application-bspu4tiikfmmfgrk47jg
HTTP status code 200
Pipeline is successfully deleted.
Body
Media type: application/json
Type: asf-api-types.Acknowledged
Example:
{
"acknowledged": true
}
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Simulate pipeline by ID.
post /_ingest/pipeline/simulate/{pipelineID}
Simulate pipeline by ID.
- application:update
Analytics Security Facede supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- pipelineID: required(string)
Pipeline ID.
Example:
application-bspu4tiikfmmfgrk47jg
Body
Media type: application/json
Type: asf-api-types.IngestPipelineRequestSimulateWithPipelineID
Example:
{
"docs": [
{
"_source": {
"appVersionName": "bspu4tiikfmmfgrk47jg-v1",
"appName": "bspu4tiikfmmfgrk47jg",
"@timestamp": "2021-05-26T00:17:08.903Z",
"serverTimestamp": 1621988228880,
"dataSample": {
"humidity_sensor": 54,
"PM_2_sensor": 534,
"air_quality_index": 5,
"PM_10_sensor": 270,
"ozone_sensor": 297,
"pressure": 828.9828409507737,
"nitrogen_dioxide_sensor": 764,
"tp": 11
},
"@version": "1",
"endpointId": "4aae8471-5c7d-499a-9e5b-dafaba23ff66",
"tenantId": "d6312fc1-4c5d-4d1d-8c8c-8ab16435b560"
}
}
]
}
HTTP status code 200
Simulated pipeline result by ID.
Body
Media type: application/json
Type: asf-api-types.IngestPipelineResponseSimulateWithPipelineID
Example:
{
"docs": [
{
"doc": {
"_index": "_index",
"_type": "_doc",
"_id": "_id",
"_source": {
"@timestamp": "2021-05-26T00:17:08.903Z",
"serverTimestamp": 1621988228880,
"appName": "bspu4tiikfmmfgrk47jg",
"endpointId": "4aae8471-5c7d-499a-9e5b-dafaba23ff66",
"@version": "1",
"tenantId": "d6312fc1-4c5d-4d1d-8c8c-8ab16435b560",
"dataSample": {
"computedValue": 540.3868793193626,
"ozone_sensor": 297,
"nitrogen_dioxide_sensor": 764,
"PM_2_sensor": 534,
"temperatureLevel": "NORMAL",
"PM_10_sensor": 270,
"humidity_sensor": 54,
"pressure": 828.9828409507737,
"air_quality_index": 5,
"tp": 11
},
"appVersionName": "bspu4tiikfmmfgrk47jg-v1"
},
"_ingest": {
"timestamp": "2021-12-13T15:09:15.996099824Z"
}
}
}
]
}
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Simulate pipeline with body data.
post /_ingest/pipeline/simulate/
Simulate pipeline with body data.
Body
Media type: application/json
Type: asf-api-types.IngestPipelineSimulateRequest
Example:
{
"pipeline": {
"processors": [
{
"set": {
"if": "ctx.dataSample.tp > 30",
"field": "dataSample.temperatureLevel",
"value": "HIGH"
}
},
{
"set": {
"if": "ctx.dataSample.tp >= 0",
"field": "dataSample.temperatureLevel",
"value": "NORMAL"
}
},
{
"set": {
"if": "ctx.dataSample.tp < 0",
"field": "dataSample.temperatureLevel",
"value": "LOW"
}
},
{
"script": {
"lang": "painless",
"source": "ctx['dataSample']['computedValue'] = Math.log(ctx['dataSample']['ozone_sensor'] * 2) + ctx['dataSample']['PM_2_sensor'];"
}
}
]
},
"docs": [
{
"_index": "d6312fc1-4c5d-4d1d-8c8c-8ab16435b560-bspu4tiikfmmfgrk47jg-2021.05.26",
"_type": "_doc",
"_id": "DjoIpnkBs0b6s2dRQFFN",
"_score": 10.692778,
"_source": {
"appVersionName": "bspu4tiikfmmfgrk47jg-v1",
"appName": "bspu4tiikfmmfgrk47jg",
"@timestamp": "2021-05-26T00:17:08.903Z",
"serverTimestamp": 1621988228880,
"dataSample": {
"humidity_sensor": 54,
"PM_2_sensor": 534,
"air_quality_index": 5,
"PM_10_sensor": 270,
"ozone_sensor": 297,
"pressure": 828.9828409507737,
"nitrogen_dioxide_sensor": 764,
"tp": 11
},
"@version": "1",
"endpointId": "4aae8471-5c7d-499a-9e5b-dafaba23ff66",
"tenantId": "d6312fc1-4c5d-4d1d-8c8c-8ab16435b560"
}
}
]
}
HTTP status code 200
Simulated pipeline result.
Body
Media type: application/json
Type: asf-api-types.IngestPipelineSimulateResponse
Example:
{
"docs": [
{
"doc": {
"_index": "_index",
"_type": "_doc",
"_id": "_id",
"_source": {
"@timestamp": "2021-05-26T00:17:08.903Z",
"serverTimestamp": 1621988228880,
"appName": "bspu4tiikfmmfgrk47jg",
"endpointId": "4aae8471-5c7d-499a-9e5b-dafaba23ff66",
"@version": "1",
"tenantId": "d6312fc1-4c5d-4d1d-8c8c-8ab16435b560",
"dataSample": {
"computedValue": 540.3868793193626,
"ozone_sensor": 297,
"nitrogen_dioxide_sensor": 764,
"PM_2_sensor": 534,
"temperatureLevel": "NORMAL",
"PM_10_sensor": 270,
"humidity_sensor": 54,
"pressure": 828.9828409507737,
"air_quality_index": 5,
"tp": 11
},
"appVersionName": "bspu4tiikfmmfgrk47jg-v1"
},
"_ingest": {
"timestamp": "2021-12-13T15:09:15.996099824Z"
}
}
}
]
}
Template
Operations on template.
Index templates allow to define templates that will automatically be applied to new indices created. The templates include both settings and mappings.
Retrieve template.
put /{tenantID}-{applicationName}/_template
Index templates allow to define templates that will automatically be applied to new indices created. The templates include both settings and mappings.
- application:update
Analytics Security Facede supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- tenantID: required(string)
Tenant ID.
Example:
ae14b8a3-e976-41db-b74c-73f12464b78c
- applicationName: required(string)
Application Name.
Example:
bspu4tiikfmmfgrk47jg
Body
Media type: application/json
Type: asf-api-types.TemplateRequest
Example:
{
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
"serverTimestamp": {
"type": "long"
},
"appName": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"endpointId": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"@version": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"tenantId": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"dataSample": {
"properties": {
"dv": {
"properties": {
"st": {
"type": "long"
},
"id": {
"type": "long"
},
"ts": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
}
}
},
"ms": {
"properties": {
"aq": {
"type": "long"
},
"ps": {
"properties": {
"2": {
"type": "long"
},
"10": {
"type": "long"
}
}
},
"n2": {
"type": "long"
},
"o3": {
"type": "long"
},
"rh": {
"type": "long"
},
"tp": {
"type": "long"
},
"ts": {
"type": "date"
}
}
}
}
},
"appVersionName": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
}
}
}
}
HTTP status code 200
Template created successfully.
Body
Media type: application/json
Type: asf-api-types.TemplateRequest
Example:
{
"acknowledged": true
}
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /{tenantID}-{applicationName}/_template
Retrieve template.
- application:read
Analytics Security Facede supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- tenantID: required(string)
Tenant ID.
Example:
ae14b8a3-e976-41db-b74c-73f12464b78c
- applicationName: required(string)
Application Name.
Example:
bspu4tiikfmmfgrk47jg
HTTP status code 200
Template retrieved successfully.
Body
Media type: application/json
Type: asf-api-types.TemplateResponse
Example:
{
"e02e0679-2de5-48af-a2f0-c650356dc739-bspu4tiikfmmfgrk47jg": {
"order": 0,
"index_patterns": [
"e02e0679-2de5-48af-a2f0-c650356dc739-bspu4tiikfmmfgrk47jg-*"
],
"settings": {},
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
"serverTimestamp": {
"type": "long"
},
"appName": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"endpointId": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"@version": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"tenantId": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"dataSample": {
"properties": {
"dv": {
"properties": {
"st": {
"type": "long"
},
"id": {
"type": "long"
},
"ts": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
}
}
},
"ms": {
"properties": {
"aq": {
"type": "long"
},
"ps": {
"properties": {
"2": {
"type": "long"
},
"10": {
"type": "long"
}
}
},
"n2": {
"type": "long"
},
"o3": {
"type": "long"
},
"rh": {
"type": "long"
},
"tp": {
"type": "long"
},
"ts": {
"type": "date"
}
}
}
}
},
"appVersionName": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
}
}
},
"aliases": {}
}
}
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Mapping
Operations on mapping.
get /{tenantID}-{applicationName}/_mapping
- application:read
Analytics Security Facede supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- tenantID: required(string)
Tenant ID.
Example:
ae14b8a3-e976-41db-b74c-73f12464b78c
- applicationName: required(string)
Application Name (can be without this also).
Example:
bspu4tiikfmmfgrk47jg
HTTP status code 200
Mapping retrieved successfully.
Body
Media type: application/json
Type: asf-api-types.RetrieveMapping
Example:
{
"d6312fc1-4c5d-4d1d-8c8c-8ab16435b560-c1hod7irqa51r8l340ug-2021.07.04": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
"@version": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"appName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"appVersionName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"dataSample": {
"properties": {
"dv": {
"properties": {
"id": {
"type": "long"
},
"st": {
"type": "long"
},
"ts": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"ms": {
"properties": {
"aq": {
"type": "long"
},
"n2": {
"type": "long"
},
"o3": {
"type": "long"
},
"ps": {
"properties": {
"10": {
"type": "long"
},
"2": {
"type": "long"
}
}
},
"rh": {
"type": "long"
},
"tp": {
"type": "long"
},
"ts": {
"type": "date"
}
}
}
}
},
"endpointId": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"serverTimestamp": {
"type": "long"
},
"tenantId": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
System Traffic Statistics
Operations on system traffic statistics.
post /{tenantID}-kaa-system-traffic-statistics/_search
- traffic-statistic:read
Analytics Security Facede supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- tenantID: required(string)
Tenant ID.
Example:
ae14b8a3-e976-41db-b74c-73f12464b78c
Body
Media type: application/json
Type: asf-api-types.SystemTrafficStatisticsRequest
Example:
{
"size": 0,
"aggs": {
"last_day": {
"date_range": {
"field": "timeFrom",
"ranges": [
{
"from": "now-1d/d",
"to": "now"
}
]
},
"aggs": {
"total_size": {
"sum": {
"field": "receivedPayload",
"missing": 0
}
}
}
},
"last_week": {
"date_range": {
"field": "timeFrom",
"ranges": [
{
"from": "now-1w/w",
"to": "now"
}
]
},
"aggs": {
"total_size": {
"sum": {
"field": "receivedPayload",
"missing": 0
}
}
}
},
"total_size": {
"sum": {
"field": "receivedPayload",
"missing": 0
}
}
}
}
HTTP status code 200
System traffic statistics retrieved successfully.
Body
Media type: application/json
Type: asf-api-types.SystemTrafficStatisticsResponse
Example:
{
"took": 622,
"timed_out": false,
"_shards": {
"total": 2,
"successful": 2,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 10000,
"relation": "gte"
},
"max_score": null,
"hits": [
]
},
"aggregations": {
"total_size": {
"value": 21714555984.0
},
"last_day": {
"buckets": [
{
"key": "1639267200000-1639421137291",
"from": 1639267200000.0,
"from_as_string": "1639267200000",
"to": 1639421137291.0,
"to_as_string": "1639421137291",
"doc_count": 51003,
"total_size": {
"value": 227546370.0
}
}
]
},
"last_week": {
"buckets": [
{
"key": "1638748800000-1639421137291",
"from": 1638748800000.0,
"from_as_string": "1638748800000",
"to": 1639421137291.0,
"to_as_string": "1639421137291",
"doc_count": 224638,
"total_size": {
"value": 1007014961.0
}
}
]
}
}
}
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Search
Search documents.
Search documents.
post /{tenantID}-{applicationName}-{date}/_search
Search documents.
URI Parameters
- tenantID: required(string)
Tenant ID.
Example:
ae14b8a3-e976-41db-b74c-73f12464b78c
- applicationName: required(string)
Application Name (can be without this also).
Example:
bspu4tiikfmmfgrk47jg
- date: required(string)
Date of the index (can be without this also).
Example:
14-12-2021
Body
Media type: application/json
Type: asf-api-types.SearchRequest
Example:
{
"size": 0,
"aggs": {
"last_day": {
"date_range": {
"field": "timeFrom",
"ranges": [
{
"from": "now-1d/d",
"to": "now"
}
]
},
"aggs": {
"total_size": {
"sum": {
"field": "receivedPayload",
"missing": 0
}
}
}
},
"last_week": {
"date_range": {
"field": "timeFrom",
"ranges": [
{
"from": "now-1w/w",
"to": "now"
}
]
},
"aggs": {
"total_size": {
"sum": {
"field": "receivedPayload",
"missing": 0
}
}
}
},
"total_size": {
"sum": {
"field": "receivedPayload",
"missing": 0
}
}
}
}
HTTP status code 200
Successfully made search request.
Body
Media type: application/json
Type: asf-api-types.SearchResponse
Example:
{
"took": 652,
"timed_out": false,
"_shards": {
"total": 2,
"successful": 2,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 10000,
"relation": "gte"
},
"max_score": null,
"hits": [
]
},
"aggregations": {
"total_size": {
"value": 21793173173.0
},
"last_day": {
"buckets": [
{
"key": "1639353600000-1639475966058",
"from": 1639353600000.0,
"from_as_string": "1639353600000",
"to": 1639475966058.0,
"to_as_string": "1639475966058",
"doc_count": 40559,
"total_size": {
"value": 179012705.0
}
}
]
},
"last_week": {
"buckets": [
{
"key": "1638748800000-1639475966058",
"from": 1638748800000.0,
"from_as_string": "1638748800000",
"to": 1639475966058.0,
"to_as_string": "1639475966058",
"doc_count": 242845,
"total_size": {
"value": 1085632150.0
}
}
]
}
}
}
Msearch
Msearch documents.
The multi search API allows to execute several search requests within the same API.
post /{tenantID}-{applicationName}-{date}/_msearch
The multi search API allows to execute several search requests within the same API.
URI Parameters
- tenantID: required(string)
Tenant ID.
Example:
ae14b8a3-e976-41db-b74c-73f12464b78c
- applicationName: required(string)
Application Name (can be without this also).
Example:
bspu4tiikfmmfgrk47jg
- date: required(string)
Date of the index (can be without this also).
Example:
14-12-2021
Body
Media type: application/json
Type: asf-api-types.MsearchRequest
Example:
{
"query": {
"match": {
"message": "this is a test"
}
}
}
HTTP status code 200
Successfully made msearch request.
Body
Media type: application/json
Type: asf-api-types.MsearchResponse
Example:
{
"took": 652,
"timed_out": false,
"_shards": {
"total": 2,
"successful": 2,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 10000,
"relation": "gte"
},
"max_score": null,
"hits": [
]
}
}