All Apps and Add-ons

Extract Data with Field Definition

ciscotek9
New Member

How would you extract particular info from raw data that is not defined by a field and then add it to a new field?

The name of databases being sent to logs all end in *db but can appear randomly in the raw data.

We want to pull them from raw data put them in column by themselves named "Database" with the corresponding raw data line that it appears in.

95% of the databases named end in "*db". A few are one offs but when we can find the solution for the ones that end in *db hopefully the answer will come.

0 Karma

kristian_kolb
Ultra Champion

Well, one thing to try is to use rex to extract the name as a field. If this works fine, you can then make it permanent by making the changes in props.conf (or via IFX).

Consider these sample events;

"The quick brown fox-db jumps over the lazy dog"
"All work and no play makes Jack a dull boydb"
"Crane-db, the most powerful tool at the building site" 

To extract the database-strings from these type of events, you might try;

...| rex "(?<my_db>\S+db)" | table my_db

and the output would be;

my_db
-----
fox-db
boydb
Crane-db

Please provide a few sample events if you want more qualified advice.

lukejadamec
Super Champion

Can you post some examples of the logs, and point out what you mean by 'raw data line'?

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!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...