Hello All,
I am wondering if it is possible to query one index based on the results of another query from a different index? For instance I have added my basic watcher below with a chained input. Not entirely sure how this should work but basic I want to iterate over all the results returned in the first chained input 'BLACKLIST-IP' and query for those IP's in the REAL-DATA index. If true then return that IP into another index called RESULTS. Below is my input config thus far.
"input": {
"chain": {
"inputs": [
{
"BLACKLIST-IP": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"black-ip"
],
"types": [],
"body": {
"query": {
"match": {
"type": "ip-src"
}
}
}
}
}
}
},
{
"REAL-DATA": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"real-data"
],
"types": [],
"body": {
"query": {
"match": {
"script": {
"script": {
"lang": "painless",
"inline": "for (artifact in ctx.payload.BLACKLIST_IP.hits.hits) return artifact"(search for this artifact in the REAL-DATA index)
}
}
}
}
}
}
}
}
}
]
}
},