DEV Community

Maxime Guilbert
Maxime Guilbert

Posted on • Edited on

4 3

Splunk - Add marker lines in a column chart

In our dashboards, it can really help to have marker lines to show where it's critical or not.

And today, we will see how to do it in a Splunk Column Chart!


How to do it?

The request

First, you need to define different variables in your request which will correspond to your different markers.



... | eval warning = 1 | eval critical = 2 ...


Enter fullscreen mode Exit fullscreen mode

Then, be sure that these values are returned in your response data.



| table x y warning critical


Enter fullscreen mode Exit fullscreen mode

The dashboard

In your dashboard definition, you need to add an option called charting.chart.overlayFields. It will contains all the parameters names to use as marker.



...
<chart>
  <title>My chart</title>
  <search>
    <query>...</query>
    <earliest>$time.earliest$</earliest>
    <latest>$time.latest$</latest>
  </search>
  <option name="charting.chart">column</option>
  <option name="charting.chart.overlayFields">warning,critical</option>
  <option name="charting.drilldown">none</option>
</chart>
...


Enter fullscreen mode Exit fullscreen mode

And now you have beautiful markers on your chart!
Alt Text

Customize colors

To customize the colors, you have to add another option called charting.fieldColors. It will contains a JSON object with your parameter name as key and the color as value.



<option name="charting.fieldColors">{"warning":0xf77f00, "critical":0xd62828}</option>


Enter fullscreen mode Exit fullscreen mode

And now you can play with it!


I hope it will help you!

Don't hesitate to give some feedback to help me to improve my writing skills. Thanks!

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay