Splunk Search

Add Data: A text file is being interpreted as a binary file

jchensor
Communicator

I do realize there is another thread where someone asks the same question, but he solved his problem when he checked his file with a hex editor. I've done the same, and made sure the very first byte in the file is just the first ASCII character of the log file. The "sample data" that Splunk has on their website is formatted similarly, with the first byte just being the first ASCII character of the log file, and I can get that file parsed just fine.

My file name is just "ERRORLOG", so I even changed it to "ERRORLOG.txt" and such. I've used editors like Crimson Editor to save it as a plain text file instead of an Auto Detect file. I've tried all sorts of things, but it's always interpreted as a binary file, according to the splunkd log.

Anyone have any idea what may be the problem?

Thanks, guys.

  • JC
Tags (3)
0 Karma
1 Solution

jchensor
Communicator

Actually, nevermind. I don't know why it didn't immediately become obvious when I opened it up in the hex editor, but the file was formatted in Unicode (Little Endian). As soon as I changed it to ASCII, it was fine.

View solution in original post

0 Karma

jchensor
Communicator

Actually, nevermind. I don't know why it didn't immediately become obvious when I opened it up in the hex editor, but the file was formatted in Unicode (Little Endian). As soon as I changed it to ASCII, it was fine.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...