Getting Data In

Re Route data coming from Syslog to new index

Naa_Win
Path Finder

Hello,

I have below inputs stanza to monitor the syslog feed coming to index=base, 

Now we need to filter the out with a specific host names and re route them to new index

monitor:///usr/local/apps/logs/*/base_log/*/*/*/*.log]
disabled = 0
sourcetype = base:syslog
index = base
host_segment = 9


example I have hosts  (serverxyz.myserver.com, myhostabc.myserver.com, myhostuvw.myserver.com), now i want to match *xyz* and *abc* and re route to new index. since the old config has /*/ which feeds everything to old index i wanted to add balklist to the old stanza to avoid ingesting to both index.

OLD Stanza :

monitor:///usr/local/apps/logs/*/base_log/*/*/*/*.log]
disabled = 0
sourcetype = base:syslog
index = base
host_segment = 9
blacklist = (*xyz*|.*\/*abc*\/)

NEW  Stanza :

monitor:///usr/local/apps/logs/*/base_log/*/*/*xyz*/*.log]
disabled = 0
sourcetype = base:syslog
index = mynewindex
host_segment = 9

monitor:///usr/local/apps/logs/*/base_log/*/*/*abc*/*.log]
disabled = 0
sourcetype = base:syslog
index = mynewindex
host_segment = 9

Labels (1)
Tags (1)
0 Karma

isoutamo
SplunkTrust
SplunkTrust
Hi
I afraid that you must do this in HF or IDX with props and transforms? The reason for that is those file/directory names. I think that splunk internally expand those in one equal name and for that reason you have only one monitoring stanza not three?
Maybe you could try to put those in different order, put that wildcard only into latest. Use btool to look how splunk see those and in which order it put those. Another tool to check how those are read is use “splunk list inputstatus” that shows which files it has read and which stanza those belongs.
r. Ismo
0 Karma

Naa_Win
Path Finder

Hello. I tried this but i didn't worked. 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Naa_Win ,

let me understand:

you want to send data from abc servers to new index and all the others to the old one, is it correct?

you could try something like this:

monitor:///usr/local/apps/logs/*/base_log/*/*/*/*.log]
disabled = 0
sourcetype = base:syslog
index = base
host_segment = 9
blacklist1 = /usr/local/apps/logs/*/base_log/*/*/*xyz*/*.log
blacklist2 = /usr/local/apps/logs/*/base_log/*/*/*abc*/*.log

monitor:///usr/local/apps/logs/*/base_log/*/*/*xyz*/*.log]
disabled = 0
sourcetype = base:syslog
index = mynewindex
host_segment = 9

monitor:///usr/local/apps/logs/*/base_log/*/*/*abc*/*.log]
disabled = 0
sourcetype = base:syslog
index = mynewindex
host_segment = 9

Ciao.

Giuseppe

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!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...