Splunk Search

Why am I getting error "File has no line endings" when trying to upload my lookup CSV file?

ashnet16
Path Finder

Every time I try I try to upload my CSV, I receive the following message:

Encountered the following error while trying to save: In handler 'lookup-table-files': File has no line endings.

I added the file directly to the $SPLUNK_HOME/etc/apps//local/, but no results are returned. Any thoughts?

Tags (3)

l0gik
Explorer

I had an xls file that I saved over as .csv to use as a lookup and I got this error when trying to use the file that way. I advise to bring the file in to notepad++, click view->show symbols-> show all characters, you want to see CR LF af the end of each line. If you see CR only go to edit->EOL Conversion->Windows Format.

As info CR stands for Carriage Return
LF stands for Line Feed

Linux format only uses CR whereas windows format uses CR and LF together. Apparently splunk is looking for these LF indicators to denote line endings.

daniel_augustyn
Contributor

Just open a CSV file with a text editor like Sublime for example, remove extra characters at the end, save it as a CSV file.

saurabh_tek11
Communicator

I opened that CSV file with notepad++ and hit enter in the last of first row.
so my csv now has 2 rows.
i saved it and it didn't give the error this time.

0 Karma

tlagatta_splunk
Splunk Employee
Splunk Employee

This is a common problem when converting an Excel file to CSV. Try saving it as Windows Comma Separated Value (.csv), then you should be able to successfully upload the lookup.

(Thanks to some friendly PS consultants for the help!)

MarioM
Motivator

is your file utf8 encoded? and .csv? if added manually the csv file has to be in $SPLUNK_HOME/etc/apps/app_name/lookups then you need to add the following in $SPLUNK_HOME/etc/apps/app_name/local/transforms.conf :

[<any name>]
filename = myfile.csv
0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...