Splunk Search

need to extract multiple values for a field in a custom event

ssyed2009
New Member

The whole event is coming in as below. Need eventtype to extract "event_type={type}" and size to extract all the values in size
{"event_type":"event_type=adsad","size":"128844"}
{"event_type":"event_type=dsadsa","size":"388719"}
{"event_type":"event_type=blue","size":"1841504"}
{"event_type":"event_type=bluecoat","size":"221712725587"}
{"event_type":"event_type=casmdsad","size":"12356947232"}
{"event_type":"event_type=cisco-ddddd","size":"1553892585172"}
{"event_type":"event_type=cisco-edsd","size":"42949321020"}
{"event_type":"event_type=cyberark-dsds","size":"77274472"}
{"event_type":"TOTAL","size":"4314601844158"}

Tags (1)
0 Karma

ivanreis
Builder

please try this one:
"event_type=(?\w[a-zA-Z-]+)\D+(?\d*)

https://regex101.com/r/4HkCyb/1
very good site to test regex expressions -> www.regex101.com

0 Karma

ivanreis
Builder

Sorry I pasted the wrong regex
"event_type=(?\w[a-zA-Z-]+)\D+(?\d*)

0 Karma

sduff_splunk
Splunk Employee
Splunk Employee
| rex max_match=9999 "event_type=(?<event_type>[^\"]+)\",\"size\":\"(?<size>\d+)\""
0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...