All Apps and Add-ons

Am i missing something or Splunk fails to extracting fields from _raw randomly?

durandfr
New Member

Hello Splunk Ninjas...

I came across some peculiar behaviors recently and cannot get my head around it...My best guess is to fully leverage the power of all your combined brains into shedding some light...eventually?

Here's the deal:

I get an incremental feed from an Oracle db via dbx2 and it seems to be working flawlessly. _raw is subsequently made of all combined db rows and column which displays onscreen as comma separated value events. For each event, there is an AUTHOR which I've validated from the db.

[base search] | table _raw, AUTHOR

But, somewhat, the AUTHOR field failed to be extracted, even though is belongs to _raw as illustrated below:
alt text

Any clues ladies and gents?

Many thanks for your help.

0 Karma

durandfr
New Member

Resolved with [base search] | eval AUTHOR=tostring(AUTHOR) | rex field=_raw "AUTHOR=\"(?<AUTHOR>\w+)\"" - Splunk devs - is this expected behaviour?

0 Karma

durandfr
New Member

Actually scratch that out - this extract AUTHOR=Null...

0 Karma

ddrillic
Ultra Champion

You can try extracting field by field, something like -

| eval _raw="AUTHOR='name1'"
| rex field=_raw AUTHOR='(?<author_name>\w*)'
0 Karma

bcatwork
Path Finder

I am unsure of why the extraction for this field failed automatically, but you can certainly add a regular expression before your table expression to force splunk to do some additional field extraction.

something like

 rex field=_raw "AUTHOR=\"(?<AUTHOR>\w+)"

So you would have

[base search] | [regex] | [stats or table..etc]
0 Karma

durandfr
New Member

thank you bcatwork - this is what I've also try to apply as workaround but it doesn't force the extraction.Question remains though as why it ain't extracted automatically from some event, while it is from the others (99.8% of all events).

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...