Splunk Conf File Syntax Highlighting
Syntax highlighting for Splunk .conf files in Sublime Text 2 & 3
Details
Installs
- Total 5K
- Win 2K
- Mac 2K
- Linux 1K
Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | Sep 20 | Sep 19 | Sep 18 | Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 2 |
Mac | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 3 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 2 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 1 |
Linux | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 2 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Sublime Text syntax highlighting for .conf files
Sublime Text is awesome! But, there's no great way to get syntax highlighting for a Splunk .conf file… until now!
It works with Sublime Text 2 & 3!
Before
After
Installation
- Install it from Package Control - search for
Splunk Conf File Syntax Highlighting
Manual Installation
- Clone the repo
cd sublime-splunk-conf-highlighting
Sublime Text 2
cp splunk-conf.tmLanguage ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/user/splunk-conf.tmLanguage
Sublime Text 3
cp splunk-conf.tmLanguage ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/user/splunk-conf.tmLanguage
Patterns
Patterns are used to identify some part of a file.
Patterns used by this package:
^# DO NOT EDIT THIS FILE\\!$
- marks any lines as invalid if they are# DO NOT EDIT THIS FILE!
^#.*$
- marks any lines that start with#
as a comment^\\[.*\\]$
- marks any line starting with[
and ending with]
as a stanza^[\\w+\\.\\-\\:]+
- marks the beginning of a line as a conf key; defined by any whitespace, alphanumeric,-
or:
characters=
- marks any=
as an equals sign
Patterns have 3 main attributes:
match
(or,begin
andend
): regex patternsname
: aTextMate
language grammar group,comment.line
for an inline commentcomment
: a comment about the pattern
Resources
- This TextMate Language Grammars guide is really helpful for figuring out what name to use for each rule.
Development Notes
There are 2 important files here:
splunk-conf.YAML-tmLanguage
- TheAAAPackageDev
package compiles this to the following, this YAML file is much easier to usesplunk-conf.tmLanguage
- This is a TextMate language definition file in XML format. SublimeText uses this format, it's a necessary evil.Install package control if you haven't already
cmd + shift + P (Mac) or ctrl + shift + P (Windows)
- Install package
- AAAPackageDev
Open
splunk-conf.YAML-tmLanguage
cmd + B should update
splunk-conf.tmLanguage
, make a small change and see if it worked. If not, play with your build system settings under Tools -> Build SystemDuring development you'll need to constantly copy the
splunk-conf.tmLanguage
into your Sublime Text package folder, like so:cp splunk-conf.tmLanguage ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/user/splunk-conf.tmLanguage
If something doesn't seem to update, quit & reopen Sublime Text and it should work.