|
I have a script that sends something like the following to stdout:
etc... This list goes on for as many vpaths as there are on the host. I'd like to capture this via Splunk, but I need to split it up by vpath entry; I don't want the entire output to be one big entry. The script runs from $PLUNK_HOME/etc/apps/fc/bin/foo.sh on the forwarder and gets indexed as sourcetype "datapath-device" I added a props.conf on the forwarder in $SPLUNK_HOME/etc/apps/fc/local with the following entry:
Unfortunately, it's not breaking up the output. Instead I get one huge entry with info on all the vpaths. I'm not sure if my regular expression is wrong or if props.conf is in the wrong place. Any suggestions are appreciated. Thanks! |
|
You need to update the props.conf in $SPLUNK_HOME/etc/system/local on the indexer, not the forwarder.. I was able to use the following entry (replace TEST with what your sourcetype is)
Edit: Also, you may have to re-index the data to pick up the changes... Brian Worked beautifully, thanks!!!
(30 Aug '10, 17:35)
Branden
|
|
Yeah, as Brian Osburn says, this configuration must go where-ever the parsing phase occurs. See here. I notice there are also no timestamps, so you might want to add a line:
(or some other more complicated config if you need to get it from the file name) Actually, as a follow-up question to Brian and gkanapthy... I have those two lines as part of the output: 0 fscsi0/hdisk1 OPEN NORMAL 123456 0 1 fscsi1/hdisk2 OPEN NORMAL 345667 0 I'd like to create a regular expression that pulls out the fields from the first line, then a regular expression to pull the fields from the second line (though the fields would have slightly different names from one line to another). In other words, I'd like a path_num0 and a path_num1 field. How do I use regex to distinguish one line from the next? Thanks!
(30 Aug '10, 18:12)
Branden
1
You're not going to be able to do this very well with search-time regex. What you probably need is the "multikv" command. You might need to do a change on _raw (using
(30 Aug '10, 18:31)
gkanapathy ♦
|
