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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...