Getting Data In

How does Splunk calculate linecount?

mloven_splunk
Splunk Employee
Splunk Employee

I have logs that are linebreaking correctly, and are single line events, but the linecount is showing as "2".

I poked around in the original file and there seems to only be single line endings on each line (per vi :set list)

What does Splunk use to calculate linecount?

mattymo
Splunk Employee
Splunk Employee

Hello from the future!

I ran into this exact thing working with OpenTelemetry's HEC exporter. 

It turns out if the "raw" field contains a "\n" it will increment the linecount to 2. 

This is likely because Splunk's default line breaker behaviour is to drop any new lines as part of the capture group it uses "([\r\n]+)" so the logic assumes new lines would be removed.

so if it somehow sneaks into raw (in my case it skips linebreaking due to hec event endpoint)  even tho you dont see it in the raw even on screen it looks to trigger the linecount to be 2. 

 

 

- MattyMo
0 Karma

jplumsdaine22
Influencer

@mloven now that you work for Splunk did you get an answer? I'm seeing the same behavior

0 Karma

cramasta
Builder

Also seeing the same behavior where one line events are showing up at 2. Also only seeing single line endings when checking out the log on the forwarder host

0 Karma

twistedsixty4
Path Finder

I dont know if this answers your question, but you might find your answer here..
http://docs.splunk.com/Documentation/Splunk/6.0.1/Data/Indexmulti-lineevents

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...