Splunk Search

What would be the regex to map the host to my incoming data?

a212830
Champion

I want to map the host to data coming in and need help with the regex to put in transforms.conf.

The data is:

metric_name=xen.cpu0 timestamp=1420641286 value=0.0007 uuid=56fb671c-4824-a537-fbda-725547d6d980 vmname=anythinghere.abc.com

I want to map vmname to host. What would the regex be for that?

0 Karma
1 Solution

chanfoli
Builder

The following seems like a simple approach which is worth a try for the REGEX part of the stanza :

REGEX = vmname=(\S+)

of course you would also use the following for overriding the host metadata in the appropriate transforms stanza:

FORMAT = host::$1
DEST_KEY = MetaData:Host

View solution in original post

chanfoli
Builder

The following seems like a simple approach which is worth a try for the REGEX part of the stanza :

REGEX = vmname=(\S+)

of course you would also use the following for overriding the host metadata in the appropriate transforms stanza:

FORMAT = host::$1
DEST_KEY = MetaData:Host
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...