Splunk Search

universal rex for extract intersting fields like (url, uri, user, email, ip, etc)

indeed_2000
Motivator

Hi

is there any universal or general rex to extract every known intersting fields like  (url, uri, user, email, ip, etc) from logs?

Thanks

Labels (4)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

Hey, if you know a way to universally extract fields from any log, give us a hint.

But seriously - there are so many log types out there that there's no possibility to parse them all the same way.

How would you want to parse let's say CSV files, json structures, CEF events and multiline events from a tk102 gps logger?

It's like asking if you know a universal way to talk to anyone, regardless of what language he speaks.

That's simply not possible.

0 Karma

indeed_2000
Motivator

simple log file (one event per line no json no csv just simple and unistructural one)

Here is the pattern:

TIMESTAMP    LOGLEVEL     SOMEMESSAGE

 

need to whereever find (url, uri, user, email, ip, etc) extract them.

Thanks,

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @indeed_2000,

I need to have some sample (three or four events) of your logs to create a regex for field extraction.

Ciao.

Giuseppe

0 Karma

PickleRick
SplunkTrust
SplunkTrust

If you have chunks of data that are easily distinguishable, you can make regex-based extractions that will find them wherever in the event they are. Mind you however, that not many types of data chunks like that can be reliably specified (so that they cover all possiblities and do not capture false positives).

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @indeed_2000,

Splunk by itself recognize the pairs field=value.

Then, if you installe some Add-On for the technologies you're monitoring (e.g. Splunk_TA_Windows for Windows logs), you already have many field extractions just ready for you.

At the end, you have the possibility to create your own field extractions using regexes, but they are custom and specified for the logs you're analyzing.

In addition there's the regex101.com site that's very helpful for your regexes extractions.

If you need an help for your logs, please share them and surely you'll have a very quick help.

Bye.

Giuseppe

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...