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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...