Getting Data In

Overriding host-field

dav_muel
Engager

Hi,

I have events like this:

server=serverA
field1=foo
field2=bar

And I would like to override the host-field with serverA so I configured on our indexers:

props.conf

[foo:bar]
DATETIME_CONFIG = CURRENT
LINE_BREAKER = field2=.*([\r\n]+)
SHOULD_LINEMERGE = false
TRANSFORMS-A = trans_host

transforms.conf

[trans_host]
REGEX = SERVER\=(\w+)$
FORMAT = host::$1
DEST_KEY = MetaData::host

 

But it's not working.. I still get the original host-value.
What am I missing here?

Labels (1)
0 Karma

scelikok
SplunkTrust
SplunkTrust

Yes, because on your sample data it is uppercase. Since regex work case sensitive , it should work.

If this reply helps you an upvote and "Accept as Solution" is appreciated.

scelikok
SplunkTrust
SplunkTrust

Hi @dav_muel,

Your problem maybe in REGEX, please try below.

[trans_host]
REGEX = server\=(\w+)
FORMAT = host::$1
DEST_KEY = MetaData::host
If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

Funderburg78
Path Finder

So what your saying is he needs to use lowercase server instead of uppercase server?.?

0 Karma
Get Updates on the Splunk Community!

Federated Search for Amazon S3 | Key Use Cases to Streamline Compliance Workflows

Modern business operations are supported by data compliance. As regulations evolve, organizations must ...

New Dates, New City: Save the Date for .conf25!

Wake up, babe! New .conf25 dates AND location just dropped!! That's right, this year, .conf25 is taking place ...

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud  In today’s fast-paced digital ...