Splunk Search

How can I find out the length of a line in a log file?

approachct
Path Finder

We have a CSV file that we import into splunk daily. We have at least one line that is too long and is possibly corrupted. How can I find out the maximum line length of a raw event in the CSV. That is to say, the length of the full line, not the length of the individual fields in the CSV.

Tags (2)
0 Karma

southeringtonp
Motivator

Assuming single-line events, eval can do it:

| eval line_length=len(_raw)
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...