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!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...