Splunk Search

Want to extract FOID= into two field, Pls help

jayavasge
New Member

05:45:25.985 [http-nio-8080-exec-137] INFO c.b.h.i.s.i.OrderDecompositionServiceImpl - POID=20275475 FOID=TRAFFIC_MGMT,43375717 FOID=CPE,43375719 FOID=RADIUS,43375721 FOID=WCLI,43375723

Tags (1)
0 Karma

woodcock
Esteemed Legend

Either this:

... | rex mode=sed "s/^.*?FOID//"
| rex max_match=0 "=(?<Type>[^,]+),(?<Number>\d+)"

OR this:

... | rex mode=sed "s/^.*? - //g s/FOID=//g s/,/=/g"
| kv
0 Karma

vinod94
Contributor

Hi @jayavasge ,

You can try this ...

Your search | rex max_match=0 "FOID\=(?P<type1>[^\,]+)\,(?P<number1>[^\s]+)" 
| eval zipped= mvzip(type1,number1,"!!!!!number1=") 
| mvexpand zipped 
| fields _time zipped 
| mvexpand zipped 
| rex field=zipped "^(?P<Type>.*)!!!!!number1\=(?P<Number>\d+)"
|table  Type Number

for example ,
this is a run anywhere search

| makeresults 
| eval data="05:45:25.985 [http-nio-8080-exec-137] INFO c.b.h.i.s.i.OrderDecompositionServiceImpl - POID=20275475 FOID=TRAFFIC_MGMT,43375717 FOID=CPE,43375719 FOID=RADIUS,43375721 FOID=WCLI,43375723" 
| rename data as _raw 
| rex max_match=0 "FOID\=(?P<type1>[^\,]+)\,(?P<number1>[^\s]+)" 
| eval zipped= mvzip(type1,number1,"!!!!!number1=") 
| mvexpand zipped 
| fields _time zipped 
| mvexpand zipped 
| rex field=zipped "^(?P<Type>.*)!!!!!number1\=(?P<Number>\d+)"
|table  Type Number

let me know if this works...

0 Karma

sudosplunk
Motivator

Hi there, can you let me know what is expected output?

0 Karma

jayavasge
New Member

Type Number
TRAFFIC_MGMT 43375717
CPE 43375719
RADIUS 43375721
WCLI 43375723

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...