POST /test_index-2024-04-17/_doc
{
"field_to_check": "old_value",
"field_to_update": "old_value"
}
POST /test_index-2024-04-18/_doc
{
"field_to_check": "old_value",
"field_to_update": "old_value"
}
....
Now I want to create watcher on top of this index for some background work. I created watcher something like below but not able to change index based on current date.
I don't know if it's possible to do this in the "index" section, but you could create a data view that groups all your indexes together, for example "test-index*". Then you can use the query system and the condition to filter the right index.
In this example, the query uses a script as a filter.
The first part corresponds to a runtime field (a calculated field). You can modify this script to extract the date contained in the name of your index (the _index field).
The second part corresponds to the filter, in this case based on the value returned by the runtime field
I think this query could be simplified, by creating a runtime field directly in your dataview. This runtime field would return the date contained in your index name. Then, you could use this runtime field to filter your Watcher query.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.