Getting Data In

How use the transform.conf to filter event value and Host

rex_rafa
New Member

I have an index receiving events from some hosts, I create a new index and need to send for this new index data that contains the work debug, I create this rule bellow and work.

[ABC]
REGEX = debug
DEST_KEY = _MetaData:Index
FORMAT = debug

The problem is I need to send this event to new index only it has the word debug and specific hosts.
If debug and host=xxx send for index debug if have only debug still sending for the old index.

Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi rex_rafa,
you could try to use your transformation for the hosts to filter, in other words:
in props.conf:

[host::xxx]
TRANSFORMS-override_index=override_index

In transforms.conf:

[override_index]
REGEX = debug
DEST_KEY = _MetaData:Index
FORMAT = debug

Ciao.
Giuseppe

View solution in original post

rex_rafa
New Member

I use that and work, but I don't know why, but some events sting going for the other index, In 20 events 18 went to correct index and 2 for the wrong index.
I cant understand why it's happening,

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi rex_rafa,
you could try to use your transformation for the hosts to filter, in other words:
in props.conf:

[host::xxx]
TRANSFORMS-override_index=override_index

In transforms.conf:

[override_index]
REGEX = debug
DEST_KEY = _MetaData:Index
FORMAT = debug

Ciao.
Giuseppe

gcusello
SplunkTrust
SplunkTrust

Hi rex_rafa,
check the regex, usually this is the problem.
Then check the hostname.

Ciao.
Giuseppe

0 Karma

rex_rafa
New Member

Do you know if have any way to see the logs of this transforms.conf?
Because If I get the events and use the https://regexr.com/ to validate the regex, the regex is correct.
The host is correct too, but is strange, because just few events are going to the wrong index.

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi rex_rafa,
About the regex check you can do it also in Splunk Search App using the regex command, sometimes, there''s something different.

Anyway, did you checked regex and host values at the same time?
you could use something like this:
| index=wrong_index
| regex "debug"
| table _time host _raw
In this way you can check if events with "debug" have the correct host value or a different one.

Ciao.
Giuseppe

0 Karma
Get Updates on the Splunk Community!

Good Sourcetype Naming

When it comes to getting data in, one of the earliest decisions made is what to use as a sourcetype. Often, ...

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Splunk App for Anomaly Detection End of Life Announcement

Q: What is happening to the Splunk App for Anomaly Detection?A: Splunk is officially announcing the ...