Splunk Search

How to extract a new field from 'source' (or others metadata) fields?

tcmarquesi
Explorer

I need to extract a field that is a substring from 'source' field. My intention was to use something like a regex in transforms.conf, but seems I can't do it because 'source' is metadata. So, once 'source' is not in raw event, what is the better (or only) way to do this extraction?

0 Karma
1 Solution

bshuler_splunk
Splunk Employee
Splunk Employee

SOURCE_KEY = MetaData:Source

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi bshuler [Splunk]
if you want to maintain the original source and create a new field, you could extract this field in your search

your_search | rex field=source "your_regex"

or using the web field extraction inserting in the regex

your_regex in source

Bye.
Giuseppe

0 Karma

bshuler_splunk
Splunk Employee
Splunk Employee

SOURCE_KEY = MetaData:Source

0 Karma

tcmarquesi
Explorer

Thank you!

I should had read more the docs before asking... lol

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...