Splunk Search

How to regex the raw data?

splunkuseradmin
Path Finder

hi all,
I am trying to extract field from Splunk "extract more fields" feature, its not showing as the logs in events section, which is in json format.

below is the sample log from which I need to extract or regex from field "id"="+779988663344" and "id" = 333222268888 numbers.

"Session-IngresslId": "999999999-9999999-999999999@SSS.com", "EgressId": "999999999-9999999-999999999@b.com",  "Accc-ll-Id": "", "Generic-Id": "", "Id": "+779988663344\" ;tag=7777777777-4444444444\"", "Id": "333222268888\" \""

all events are in json format but when we are using field extractor I see all above kind of raw events.
thanks for helping

Tags (2)
0 Karma
1 Solution

nabeel652
Builder

For JSON type logs it is better to tell the source that is collecting logs that field extractions are of type JSON. On the source machine (or wherever you are ingesting logs from under props.conf add this stanza:

[your:sourcetype]
TRUNCATE = 0
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
KV_MODE = JSON

Splunk will automatically extract all the fields for you and show you nicely highlighted in the _raw as well.

View solution in original post

0 Karma

nabeel652
Builder

For JSON type logs it is better to tell the source that is collecting logs that field extractions are of type JSON. On the source machine (or wherever you are ingesting logs from under props.conf add this stanza:

[your:sourcetype]
TRUNCATE = 0
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
KV_MODE = JSON

Splunk will automatically extract all the fields for you and show you nicely highlighted in the _raw as well.

0 Karma

splunkuseradmin
Path Finder

thanks but got working using regex.

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 ...