Hi all,
I am trying to aggregate information of multi events to one event using aggregation filter of logstash. for example events are as following:
name1=c1,name2=s1
name1=c1,name2=s1
name1=c1,name2=s1
name1=c1,name2=s2
name1=c1,name2=s2
name1=c2,name2=s1
name1=c2,name2=s1
the expected output should be as following so that shows count of fields:
c1,s1,3
c1,s2,2
c2,s1,2
for this purpose i used following aggregation filter:
aggregate {
task_id => "%{%{name1}_%{name2}}"
code => "
map['count'] ||= 0
map['count'] +=1
"
}
whereas the output is as following:
c1,s1,1
c1,s1,2
c1,s1,3
c1,s2,1
c1,s2,2
c2,s1,1
c2,s1,2
How can i solve this issue?
any advise will be so appreciated.