Getting Data In

Scripted input with current time and line merge

koudis
Explorer

Hi,
does anyone known how to setup scripted input. For example netstat from Unix app with current time and line merging ?
This output doesn't have any timestamp so I want to setup DATETIME_CONFIG=CURRENT/NONE, but when I'm using this, the output is broken into separate lines as new events and it's unreadable.
I don't know if I can somehow unset LINE_BREAKER or setup BREAK_ONLY_BEFORE to EOF ?

Thank you for any advice.

0 Karma
1 Solution

koudis
Explorer

Finally, I found a way how to do this:

[interfaces]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)

[package]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)
MAX_EVENTS=1000

[vmstat]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)
MAX_EVENTS=1000

[netstat]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)
MAX_EVENTS=1000

[who]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)
MAX_EVENTS=1000

[ps]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)
MAX_EVENTS=1000

[protocol]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)
MAX_EVENTS=1000

[lastlog]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)
MAX_EVENTS=1000

View solution in original post

koudis
Explorer

Finally, I found a way how to do this:

[interfaces]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)

[package]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)
MAX_EVENTS=1000

[vmstat]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)
MAX_EVENTS=1000

[netstat]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)
MAX_EVENTS=1000

[who]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)
MAX_EVENTS=1000

[ps]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)
MAX_EVENTS=1000

[protocol]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)
MAX_EVENTS=1000

[lastlog]
DATETIME_CONFIG = NONE
SHOULD_LINEMERGE=true
#break only at the end of input
LINE_BREAKER = (?!)
MAX_EVENTS=1000

yannK
Splunk Employee
Splunk Employee

First, make sure that the props.conf is on the indexer.

To force the current timestamp use the
DATETIME_CONFIG=CURRENT

then to handle the multiline events use should_linemerge, and add a linebreaking rule depending of your pattern. If you have scripted inputs, you can add a special line between your events to make it easier :
see http://docs.splunk.com/Documentation/Splunk/6.1.1/Data/Indexmulti-lineevents


[mysourcetype]
SHOULD_LINEMERGE=true
BREAK_ONLY_BEFORE = ^#

#
new events
on 
multiline
#
another
multiline event

koudis
Explorer

Hi,
thank you for your answer.
Unfortunately, this will not help.
SHOULD_LINEMERGE=true is default
And I don't want to break anywhere in output. I just want to receive entire output as one event. Should I setup something like this ?
BREAK_ONLY_BEFORE = ^neverexist#

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2026-2027 SplunkTrust is officially open. If ...