Splunk Search

regex field extraction on field changing data value properties

VI371887
Path Finder

hi i am having issue extracting fields from splunk field extraction and rex command

with msg field

it's has different values can be numbers, strings, path, punctuations, blank space like shown below.

"msg" :"35556"
"msg" :"<<÷] {<} ;;"
"msg" :"ycuvuuu jvbigg buivuv"
"msg" :" "

now problem is, i have written rex as
\msg\":(? \". *\") \,

but it returns value which following msg field.

"msg" :"vjvuv igivc uvviv", "origin" :"abcgc", "time" :23.45677",

Tags (1)
0 Karma

493669
Super Champion

Hi @VI371887,
Try this regex:

...|rex "msg\"\s:\"(?<msg>[^\"]+)"
0 Karma

VI371887
Path Finder

this selects msg filed, i want the value of the field to be selected, like in above example

the msg values that is.. highlighted in bold.

"msg" :"35556"
"msg" :"<<÷] {<} ;;"
"msg" :"ycuvuuu jvbigg buivuv"
"msg" :"** **"

0 Karma

493669
Super Champion

the above regex selects value for msg field as highlighted.
try this run anywhere search:

|makeresults|eval _raw="\"msg\" :\"35556\""|rex "msg\"\s:\"(?<message>[^\"]+)"
0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...