Knowledge Management

line endings in an app's config files

Justin_Grant
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?

gkanapathy
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.

piebob
Splunk Employee
Splunk Employee
0 Karma

gkanapathy
Splunk Employee
Splunk Employee

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

0 Karma

Justin_Grant
Contributor

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

0 Karma

Lowell
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. ;-(

Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...