I have log data in the following format on elasticsearch:
1- ["process_name":"nginx", "process_id":"1", "parent_process_id":"0", "syscall":"execv"]
2- ["process_name":"python", "process_id":"2", "parent_process_id":"1","syscall":"execv"]
3- ["process_name":"chrome", "process_id":"3", "parent_process_id":"2","syscall":"execv"]
The three events are related based on their process_id's and parent_process_id's. I am trying to write an EQL query to capture this chain of events. I have tried the following query:
"event_category_field" : "process_name" "query": """ sequence ["nginx" where syscall == "execv"] ["python" where syscall == "execv"] ["chrome" where syscall == "execv"] """
My goal is to join the first process i.e. "nginx" with "python" based on process_id/parent_process_id (nginx-python) and join the second process ("python") with the third process ("chrome") based on process_id/parent_process_id of (python-chrome).
Is this possible to achieve using one query? Also, is there a way to aggregate two queries in one?
Is there any other way in elastic to capture this chain of events spanning three or more than three events?