Monitoring Splunk

Why is the data not being filtered to another index?

Yaichael
Communicator

I have the following configuration for filtering the data coming from X udp port data input to an index that's being already created:

props.conf

[source::udp:X]
TRANSFORMS-new_index= route_index

transforms.conf

[route_index]
REGEX = ^"ip_add"$

DEST_KEY = _MetaData:Index

FORMAT = new_index

I know I'm almost there, but why it isn't working how it is supposed to?

Thanks!

Tags (1)
0 Karma
1 Solution

Yaichael
Communicator

I changed the configuration as follows, and it worked:

props.conf

[host::host_ip]
TRANSFORMS-new_index = route_index

transforms.conf

[route_index]
REGEX = .
DEST_KEY = _MetaData:Index
FORMAT = new_index

Thanks for the help everyone!

View solution in original post

0 Karma

Yaichael
Communicator

I changed the configuration as follows, and it worked:

props.conf

[host::host_ip]
TRANSFORMS-new_index = route_index

transforms.conf

[route_index]
REGEX = .
DEST_KEY = _MetaData:Index
FORMAT = new_index

Thanks for the help everyone!

0 Karma

s2_splunk
Splunk Employee
Splunk Employee

That will apply to everything (matching on .). Your question suggested you wanted to only route events that start with an IP address/the string "ip_add". If matching everything is what you need, cool.

0 Karma

MuS
Legend

It will match everything from host host_ip so this solution also only applies to one host; like the regex approach 🙂

0 Karma

somesoni2
Revered Legend

Try escaping the double quotes on the REGEX with backslash. ALso. ensuer the configurations are there in the Heavy forwarder/Indexer which comes first and your restart SPlunk after the change.

0 Karma

Yaichael
Communicator

In the REGEX, the ip address isn't surrounded by double quotes. I wrote it like that so the system could see my input.

Sorry for not commenting the details.

0 Karma

somesoni2
Revered Legend

Ok. I'm guessing you're using proper regex for ip address (\d+\.\d+\.\d+\.\d+) then just the literal in the
REGEX = ^ip_add$. So, does you event only contains the ip address, as you're mentioned that line 1 in your events starts and ends with ip address? That may have bee causing it to fail.

If your event starts with ip address, use this as filter REGEX = ^\d+\.\d+\.\d+\.\d+
If your event ending with ip address, use this as filter REGEX = \d+\.\d+\.\d+\.\d+$

0 Karma

s2_splunk
Splunk Employee
Splunk Employee

Without seeing a sample event it will be tricky to validate that your RegEx will actually match incoming data.
Can you share a sample?

Your other settings look correct to me.

0 Karma
Get Updates on the Splunk Community!

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 ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...