Knowledge Management

Creating field value pair

splunkingsplun1
Explorer

According to the documentation here I need to have ids_type in my events as follows ids_type="network" or ids_type="application" or ids_type="host". How can I add a field value pair to my events automatically? Would I have to create this in transforms.conf?

[netdefender]
REGEX =  Netdefender
FORMAT = ids_type=network
WRITE_META = true

This is a portion of a sample event:

Jan 30 10:32:43 192.168.1.1 Netdefender: 30-01-2014 02:54:05 WARNING

I am not sure how this works its been a long day. Help please!

0 Karma
1 Solution

somesoni2
Revered Legend

If you want to add an additional field for each sourcetype you can use calculated fields.

e.g.
props.conf (assuming 'netdefender' is your sourcetype name)

[netdefender]
pulldown_type = 1
EVAL-ids_type = "network"

This will add a field ids_type="network" for all the logs in sourcetype "netdefender"

View solution in original post

somesoni2
Revered Legend

If you want to add an additional field for each sourcetype you can use calculated fields.

e.g.
props.conf (assuming 'netdefender' is your sourcetype name)

[netdefender]
pulldown_type = 1
EVAL-ids_type = "network"

This will add a field ids_type="network" for all the logs in sourcetype "netdefender"

splunkingsplun1
Explorer

This worked just make sure to use quotes

0 Karma

asimagu
Builder

first of all you would need to specify something to extract in the regex, could we see some sample code in order to help you?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...