Splunk Search

How to extract values?

valpravin
Engager

My Log Contains

"SeqNo":4433221,"T_CODE":"ABC","VALUE":983123456,"VALUE2":"0000000000",

I am in need of VALUE field which will display 983123456 as an output tried with this query

|rex VALUE="(?[^\d*])" |table VALUE

please help

Tags (1)
0 Karma

woodcock
Esteemed Legend

Like this:

| makeresults 
| eval _raw= "\"SeqNo\":4433221,\"T_CODE\":\"ABC\",\"VALUE\":983123456,\"VALUE2\":\"0000000000\","

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution."

| rex max_match=0 "(?<KEY_1>[^:\"]+)\"?:\"?(?<VAL_1>[^:\"]+)\"?,"
| eval _raw = mvzip(KEY_1, VAL_1, "=")
| kv

I named them this way for a reason; search for _KEY_1 on this page:
https://docs.splunk.com/Documentation/Splunk/latest/Data/Configureindex-timefieldextraction

0 Karma

vnravikumar
Champion

Hi

Check this

| makeresults 
| eval temp= "\"SeqNo\":4433221,\"T_CODE\":\"ABC\",\"VALUE\":983123456,\"VALUE2\":\"0000000000\", "
|rex field=temp "VALUE\"\:(?P<value>\d+)"
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...