ok, my original input is :
2017-05-22 13:50:00.000  INFO names1 - X < 8=fac|9=154|35=V|34=9||50=Good|262=lsrx5248|263=0|264=0|265=0|146=1|269=0|269=1|10=014
2017-05-22 13:50:08.000  INFO names1 - Q > 8=fac|9=4|262=lsrx5248|0=213
2017-05-22 13:50:08.000  INFO names1 - Q > 8=fac|9=4|262=lsrx5248|0=213
2017-05-22 13:50:08.000  INFO names1 - Q > 8=fac|9=4|262=lsrx5248|0=213
2017-05-22 13:50:08.000  INFO names1 - Q > 8=fac|9=4|262=lsrx5248|0=213
2017-05-22 14:50:00.000  INFO names2 - X < 8=fac|9=154|35=V|34=9||50=BAD|262=lsyx48|263=0|264=0|265=0|146=1|269=0|269=1|10=014
2019-05-22 14:50:08.000  INFO names2 - Q > 8=fac|9=5|262=lsyx48|0=214
2019-05-22 14:50:08.000  INFO names2 - Q > 8=fac|9=5|262=lsyx48|0=214
2019-05-22 14:50:08.000  INFO names2 - Q > 8=fac|9=5|262=lsyx48|0=214
2019-05-22 14:50:08.000  INFO names2 - Q > 8=fac|9=5|262=lsyx48|0=214
filter {
grok {
match => ["messages","(?%{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{HOUR}:%{MINUTE}:%{SECOND}.[0-9]{3}) %{WORD:loglevel} %{WORD:A} - %{WORD:B} (.)(<|>) %{GREEDYDATA:C }"]
}
if "_grokparsefailure" in [tags] {
drop {}
}
 kv {
  source =>"C"
  field_split=>"|"
  value_split => "="
  	                                    
  }
mutate {
 remove_field => ["path","@version","version","message","type","host","loglevel"]
       	 
		
  rename => {  
               "50" =>"Who"
               "262" =>"id"
               ....
			   }
 add_field => { "message_out" => "%{date},%{A},%{B},%{C}" }
 }
 }
output {
    elasticsearch {
hosts => "xx.xx.xx.xx:9200"
index => "tata-%{+YYYY.MM.dd}"
       }
Now :
if you notice, x send you a type 50 and an id 262.
And Q answers on 262 and in Q, we do not have 50.
Basically they communicate on id 262.
So the goal is whenever X sends a type and an id, Q also responds to him with the id and the type that goes with it. .
Basically, I want to retrieve 50 and 262 for each message in Q.
Thanks for you help.