I have a log file that looks like this:
TIMESTAMP FIELD VALUE
e.g.
100 load 1
100 mem 23
100 free 7
103 load 2
103 mem 17
103 free 9
...
I would like to aggregate the lines with the same timestamp to be a single message. Something along the lines of this:
{
"my.timestamp"; 100
"my.load" : 1,
"my.mem": 23,
"my.free": 7
}
In Logstash it seems I can do this, though I am not yet sure how to separate data arriving from different filebeat agents. I wonder if this would be possible in filebeat already?
I tried to use the multiline feature, but I don't now who to tell it "a message is done when the timestamp changes.
I tried to use the "script" option in filebeat. I can convert the individual log strings to key-value pairs, but I don't know how to aggregate them.
Any suggestions?