Let's do a little syntax highlighting for the Splunk Processing Language.

I've extended rainbow.js on my github here so that it supports SPL. Getting it working is really quite simple.

le files

First, you get the rainbow source compiled with Splunk support. Secondly, you get the splunk syntax definition. Optionally, you can add a theme. Thats it for files

Download all 3 of those files here.

Then, in your html file, just add all three, e.g.

<script src="rainbow-custom.min.js"></script>
<script src="splunk-syntax.js"></script>
<link rel="stylesheet" type="text/css" href="monokai.css">

Or, if you're using a Splunk dashboard:

<dashboard stylesheet="monokai.css" script="rainbow-custom.min.js,splunk-syntax.js">

le code

Now, in your html, where you would like to have SPL syntax highlighted, you simply need to add:

<pre data-language="splunk">
| bucket _time span=10m
| stats count by bar