Archive

line endings in an app's config files

Contributor

We're building an app which is intended to be deployed onto Windows, Unix, and Mac versions of Splunk. In our app's config files, which OS's line ending format should we use? The question covers a few angles:

  • will any line-ending format cause trouble for Splunk itself? (Assuming no, but want to make sure)
  • if Splunk installs the app, is the installer smart enough to convert the line endings of config files being installed?
  • if we have to pick one line ending, and users manually untar and install the files, which line ending is least annoying to the default text editors used on other OS's with different line endings?

Splunk Employee
Splunk Employee
  • No, either Windows style (CR-LF) or Unix (LF) work with Splunk on any platform. I don't know about old-school Mac (CR) style, though, so don't use those.
  • The various Splunk distributions install with their native line endings.
  • About the same. I would pick Unix-style. Notepad hates it, but Wordpad handles it fine. vim can read either kind, but if you're on Solaris or AIX you don't always have vim, just vi, but the extra CR at the end of the line is just whitespace anyway.

Motivator
0 Karma

Splunk Employee
Splunk Employee

A ^M (i.e., CR) character at the end of every line.

0 Karma

Contributor

What do vi users see when they open a Windows-line-ended file? Is the file not editable or not viewable?

0 Karma

Super Champion

Agreed. I primarily use Unix EOLs in our custom apps which are deployed across platforms, and that has worked well. The notepad thing is an annoyance, but generally you shouldn't do any editing on the deployment client anyways (since any changes would be overwritten on the next deployment). It is a pain when you just want to quickly view a config file. ;-(

State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!