Knowledge Management

Why are my search time extractions not working?

Fonzie2k
Path Finder
Hi Splunkers,
Im having problems with the "EXTRACT" functions in props.conf.
Im trying to extract the fields from a log that is formatted like this (values are changed for privacy reasons):

DateTime: 2022-12-05T08:00:37
InterchangeId: asdf12-asdf12-asdf12-asdf12-asdf12
DocumentId:
Sender: foobar
Receiver: barfoo
MessageType: foo
RequesterId: bar
Status: Running
Filename: file.json

DateTime: 2022-12-05T08:00:37
InterchangeId: asdf12-asdf12-asdf12-asdf12-asdf12
DocumentId:
Sender: foobar
Receiver: barfoo
MessageType: foo
RequesterId: bar
Status: Running
Filename: file.json

I uploaded this data into Splunk, and i wrote the regexes that extracts the value.
This search works perfectly:
index=* sourcetype=test-sourcetype
| rex "InterchangeId:\s(?<InterchangeId>[^\n\r]+)"
| rex "DocumentId:\s(?<DocumentId>[^\n\r]+)"
| rex "Sender:\s(?<Sender>[^\n\r]+)"
| rex "Receiver:\s(?<Receiver>[^\n\r]+)"
| rex "MessageType:\s(?<MessageType>[^\n\r]+)"
| rex "Status:\s(?<Status>[^\n\r]+)"
| rex "Filename:\s(?<Filename>[^\n\r]+)"
| rex "RequesterName:\s(?<RequesterName>[^\n\r]+)"


However, when i try to implement this using the "EXTRACT" config in props.conf, it does not work:
[test-sourcetype]
EXTRACT-InterchangeId = InterchangeId:\s(?<InterchangeId>[^\n\r]+)
EXTRACT-DocumentId = DocumentId:\s(?<DocumentId>[^\n\r]+)
EXTRACT-Sender = Sender:\s(?<Sender>[^\n\r]+)
EXTRACT-Receiver = Receiver:\s(?<Receiver>[^\n\r]+)
EXTRACT-MessageType = MessageType:\s(?<MessageType>[^\n\r]+)
EXTRACT-Status = Status:\s(?<Status>[^\n\r]+)
EXTRACT-Filename = Filename:\s(?<Filename>[^\n\r]+)
EXTRACT-RequesterName = RequesterName:\s(?<RequesterName>[^\n\r]+)

I have used btool to verify this is picked up on the search head.
I can also see this config in the GUI: "Settings" -> "fields"
I have tried applying "KV_MODE = none" aswell, without any difference.
And yes, this code is deployed to an app on a Search head, since its an search time extraction.
I've tried with many different regex'es, to debug if that is the problem, but without any luck.

Does anyone have any idea on what im doing wrong here?
Labels (1)
0 Karma
1 Solution

Fonzie2k
Path Finder

It seems like the problem was that the setting "export = system" in the file ../appname/metadata/default.meta was missing. After adding that, the search time extration works.

View solution in original post

Fonzie2k
Path Finder

It seems like the problem was that the setting "export = system" in the file ../appname/metadata/default.meta was missing. After adding that, the search time extration works.

Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...