Hi Sajal,
The Pipeline you have specified looks good, as does the conditional. You will need to run it against your index, for example using the Reindex API:
POST _reindex
{
"source": {
"index": "default"
},
"dest": {
"index": "default_set",
"pipeline": "addaht"
}
}
Checking this against an index with two simple (one with queueName == 'A' and one with queueName == 'B'), resulted in the following:
GET default/_search
{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 2,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "default_set",
"_type" : "_doc",
"_id" : "b29B13MB1__HAGu7A4FL",
"_score" : 1.0,
"_source" : {
"@timestamp" : "2099-11-15T13:12:00",
"queueName" : "A",
"queueAHTVal" : "10"
}
},
{
"_index" : "default_set",
"_type" : "_doc",
"_id" : "Em9B13MB1__HAGu7YIN3",
"_score" : 1.0,
"_source" : {
"@timestamp" : "2099-11-15T13:14:00",
"queueName" : "B"
}
}
]
}
}
Reindexing in this way will mean that the original index is not touched.
You can also use 'update by query' to apply this to the existing index, rather than create a new one:
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html#docs-update-by-query-api-ingest-pipeline
As an alternative to using the 'Set' processor, and a set of conditionals for each possible queue value, you could use the Enrich processor, and have an Elasticsearch Index that includes the mapping of queueName to the AHTVals:
https://www.elastic.co/guide/en/elasticsearch/reference/current/match-enrich-policy-type.html
If you are happy with your ingest pipeline logic, and want to apply it automatically to new events as they arrive, you can do it by specifying the pipeline to use on your indexing requests, either when you issue index commands:
https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest.html
PUT my-index-000001/_doc/my-id?pipeline=my_pipeline_id
Or by setting the index.default_pipeline
parameter to specify your pipeline in the index settings:
https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules.html#dynamic-index-settings
Please try this and let us know how you get on,
Thanks,
Stuart.