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

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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...