3

I'm using logstash and its configuration file (documented here) looks like this:

input { file { path => "/some/path/to/file" option => 1 } } filter { if [var] == "string" { action { array_option => [ "val1", "val2", "val3" ] object_option => { str_option => "string" } } } } # this is a comment output { stdout } 

I'm looking for a helpful emacs mode that works well with files like this. The conf-mode does good highlighting, but I can't get it to indent properly. Any suggestions?

2
  • This looks very similar to Puppet configuration files, or maybe Ruby in general. What if you try any of those modes (it probably won't cover it 100%, but should be very close). Commented Sep 13, 2015 at 9:36
  • You're right. It is actually ruby. ruby-mode works perfectly. Thnx. Commented Sep 13, 2015 at 18:34

2 Answers 2

1

Although ruby-mode works pretty well, there were some problems. After trying several other modes, I found this json-mode to work perfectly.

1

Technically it's a custom grammar: https://stackoverflow.com/questions/21442715/what-is-the-format-of-logstash-config-file

This is supposed to be just for logstash configs: https://github.com/Wilfred/logstash-conf.el

I came across this answer looking for something for Atom. Nothing exists as far as I can tell, but similarly the Ruby and JSON modes in Atom do an OK job of highlighting and indenting (auto-indent also works).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.