Splunk Search

How to extract multiple values for a field in the same event using field extractions?

ssyed2009
New Member

I am trying to extract both sha256 values from the event below but Splunk is only extracting the first value. How can I fix this?

2018-02-21T13:38:23+00:00 dummy.com amp_log: Info:   Compressed/Archive File: sha256 = 12345 MID = 0001, Extracted File: File Name = 'data', File Type = 'image/x-emf', sha256 = 567890, Disposition = FILE UNKNOWN, Response received from = Cloud, Malware = None, Reputation Score = 0, upload_action = 1
0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try this (on your search head(s). Splunk restart required)

props.conf

[yourSourceType]
REPORT-extractall = extractAllKV

transforms.conf

[extractAllKV]
REGEX = (\w+)\s*=(\s|\'|\")*([^,'\"\s]+)
FORMAT = $1::$2
MV_ADD = true

View solution in original post

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Try this (on your search head(s). Splunk restart required)

props.conf

[yourSourceType]
REPORT-extractall = extractAllKV

transforms.conf

[extractAllKV]
REGEX = (\w+)\s*=(\s|\'|\")*([^,'\"\s]+)
FORMAT = $1::$2
MV_ADD = true
0 Karma

493669
Super Champion

Hi @somesoni2,
that's a good example! just one thing in FORMAT whether we need to write $1::$3 or does it work with $!::$2?

0 Karma

ssyed2009
New Member

it did work with FORMAT = $1::$2

0 Karma

493669
Super Champion

Hi @ssyed2009,
you need max_match=0 to match multiple events
try this:

...|rex max_match=0 "sha256\s*=\s*(?<sha>\d+)"
Get Updates on the Splunk Community!

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

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...