I have logs with the fields client_ip, URI and timestamp.
I want to be able to group these logs by sessions. That is, a session corresponds to a group of logs with the same IP and with consecutive and similar timestamps.
The objective is to show all the Uris that each IP accessed ordered by timestamp.
Getting to the end goal here might be almost impossible in Kibana, but we can try and do it step by step. I'll try and give some pointers in regards to what aggregations you can use to achieve the steps.
We should probably start with a data table, that seems the most basic form of looking at data.
Do a Terms aggregation by client_ip in order to split them all by IP.
You can do a date histogram as well, where you set the bucket size in seconds/minutes/etc according to what you want to set as session lenght
In order to group them together, you can do a Filter aggregation where you can combine them.
At the end, the Data Table has a sum field as well where you can see the count.
Using elasticsearch, would it be possible to somehow create an index from the existing one?
This way, I could:
. Group all the events by ClientIp
. Order by Timestamp
. Sequentially, go through each log and store the timestamp of each log as a field SessionEnd of the aggregation
. Therefore, I could compare the timestamp of each log to (SessionEnd+30minutes) to check whether I should group that log with the existing session or create a new session.
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.