grok filter:
filter {
grok {
match => { "message" => "[%{LOGLEVEL:Severity}]:[%{DATA:User_Name}]:[%{TIMESTAMP_ISO8601:event_time}]:[%{DATA:Session_ID}]:[%{DATA:Function_Name}]:[%{DATA:Event}]:[%{DATA:Activity_Status}]:[%{GREEDYDATA:message}]"
}
}
date {
match => ["timestamp", "dd/MM/yyyy HH:mm:ss"]
target => "@timestamp"
}
}
elasticsearch curl request:
curl -XGET "http://172.25.2.206:9200/elk_db/_search?size=1000&pretty" -H 'Content-Type: application/json' -d'
{
"sort": [
{ "event_time": {"order" : "asc"} }
],
"query": {
"bool": {
"must": [
{ "match": { "Session_ID": "323232" }}
]
}
}
}'
Mapping:
{"elk_db":{"mappings":{"doc":{"properties":{"@timestamp":{"type":"date"},"@version":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"Activity_Status":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"Event":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"Function_Name":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"Session_ID":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"Severity":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"User_Name":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"beat":{"properties":{"hostname":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"name":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"version":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}},"event_time":{"type":"date","format":"yyyy/MM/dd HH:mm:ss||yyyy/MM/dd||epoch_millis"},"host":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"message":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"offset":{"type":"long"},"prospector":{"properties":{"type":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}},"source":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"tags":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"timestamp":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}}}}}