Security

Inconsistent line breaking

vanaepi
Explorer

I am very new to Splunk and this may be a rookie question but I cannot find this anywhere. I have a custom generated demo log file with 1000 similarly structured lines. For some reason, Splunk reads in the first 257 lines as one event, and then the next 743 lines as separate events.

I figured it had something to do with either LINE _ BREAKER or MAX _ EVENTS but the strange thing is that it's not consistent. I would be less surprised if it grouped all my events per 257 in stead of just the first 257 and then single event per line from there on.

Could it perhaps have something to do with the fact that I don't have a timestamp added yet?

Tags (2)
0 Karma
1 Solution

kristian_kolb
Ultra Champion

Yes. If there is no timestamp Splunk will have problems to automatically create/break events.

If you really want to index the events anyway you should set the following in props.conf;

[your sourcetype]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n]+)
DATETIME_CONFIG = CURRENT

Read more about that here:

http://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf

/k

View solution in original post

jkat54
SplunkTrust
SplunkTrust

Try the truncate option in the props.conf stanza for the sourcetype. Truncate is needed when the file you're consuming is abnormally large or the lines in the file are abnormally long (no line breaks etc). From the doc, "Change the default maximum line length (in bytes)"

For instance, if you were to consume the applicationHost.config files for IIS servers you could use the following stanza in props.conf:

[iisconfig]
SHOULD_LINEMERGE = True
MAX_EVENTS = 400960
LINE_BREAKER = </configuration>
NO_BINARY_CHECK = true
TRUNCATE = 1000000

And in inputs.conf:

[monitor://C:\Windows\System32\inetsrv\config\applicationHost.conf]
disabled = 0
host = hostname
index = main
sourcetype = iisconfig
crcSalt = <SOURCE>

jkat54
SplunkTrust
SplunkTrust

Who down voted my solution? It would solve his problem if his issue was long lines. The issue that truncate solves can be explained the exact same way he explained his problem. So without a example of the data he's consuming both answers could be correct.

0 Karma

kristian_kolb
Ultra Champion

Yes. If there is no timestamp Splunk will have problems to automatically create/break events.

If you really want to index the events anyway you should set the following in props.conf;

[your sourcetype]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n]+)
DATETIME_CONFIG = CURRENT

Read more about that here:

http://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf

/k

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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

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