Splunk Search

Dotted Line Chart

Dark_Ichigo
Builder

Is it possible to create a dotted Line Chart in splunk using Advanced XML?

Tags (3)
1 Solution

bbingham
Builder

Yes it is possible, you need to modify the brush. Let me know if you need more information on it, but you need to set the line stroke.

Short answer:

<param name="charting.lineBrush">dashedStroke</param>

Here's the link: Brush Strokes

Long Answer:

I like to establish a core brush I use on a chart when I make modifications, in this case, a dashed line brush:

<param name="charting.myBrush">dashedStroke</param>
<param name="charting.myBrush.dashSize">10</param>
<param name="charting.myBrush.dashSpacing">10</param>
<param name="charting.myBrush.color">0xFF0000</param>
<param name="charting.myBrush.thickness">5</param>

Basically, this will create one super ugly thick red dashed line. When dealing with charts, you need to tell splunk how to reference the "series" of data (incase there is more then one line).

<param name="charting.myBrushPalette">list</param>
<param name="charting.myBrushPalette.brushes">[@myBrush]</param>
<param name="charting.chart.lineBrushPalette">@myBrushPalette</param>

We are telling splunk to now use a "list" for the series. This list only contains 1 option, therefore it's used for each line on the chart. You can specify additional brushes for line rendering other lines by following the same process.

<param name="charting.myBrush">dashedStroke</param>
<param name="charting.myBrush.dashSize">10</param>
<param name="charting.myBrush.dashSpacing">10</param>
<param name="charting.myBrush.color">0xFF0000</param>
<param name="charting.myBrush.thickness">5</param>
<param name="charting.myBrush2">solidStroke</param>
<param name="charting.myBrush2.color">0x00FF00</param>
<param name="charting.myBrushPalette">list</param>
<param name="charting.myBrushPalette.brushes">[@myBrush,@myBrush2]</param>
<param name="charting.chart.lineBrushPalette">@myBrushPalette</param>

This will use the dotted line for the "first" series, and a green line for the "second" series, reguardless of name.
If you want more control, use the "field" palette to define the name of the series to reference a brush.

<param name="charting.myBrush">dashedStroke</param>
<param name="charting.myBrush.dashSize">10</param>
<param name="charting.myBrush.dashSpacing">10</param>
<param name="charting.myBrush.color">0xFF0000</param>
<param name="charting.myBrush.thickness">5</param>
<param name="charting.myBrush2">solidStroke</param>
<param name="charting.myBrush2.color">0x00FF00</param>
<param name="charting.myBrushPalette">field</param>
<param name="charting.myBrushPalette.fieldBrushes">{Average_Duration:@myBrush,Count:@myBrush2}</param>
<param name="charting.myBrushPalette.defaultBrushPalette">@myBrush2</param>
<param name="charting.chart.lineBrushPalette">@myBrushPalette</param>

This will establish the "count" line as the dotted line, the "Average_Duration" line as the green line, then make any other line the same green line as "Average_Duration".

View solution in original post

bbingham
Builder

Yes it is possible, you need to modify the brush. Let me know if you need more information on it, but you need to set the line stroke.

Short answer:

<param name="charting.lineBrush">dashedStroke</param>

Here's the link: Brush Strokes

Long Answer:

I like to establish a core brush I use on a chart when I make modifications, in this case, a dashed line brush:

<param name="charting.myBrush">dashedStroke</param>
<param name="charting.myBrush.dashSize">10</param>
<param name="charting.myBrush.dashSpacing">10</param>
<param name="charting.myBrush.color">0xFF0000</param>
<param name="charting.myBrush.thickness">5</param>

Basically, this will create one super ugly thick red dashed line. When dealing with charts, you need to tell splunk how to reference the "series" of data (incase there is more then one line).

<param name="charting.myBrushPalette">list</param>
<param name="charting.myBrushPalette.brushes">[@myBrush]</param>
<param name="charting.chart.lineBrushPalette">@myBrushPalette</param>

We are telling splunk to now use a "list" for the series. This list only contains 1 option, therefore it's used for each line on the chart. You can specify additional brushes for line rendering other lines by following the same process.

<param name="charting.myBrush">dashedStroke</param>
<param name="charting.myBrush.dashSize">10</param>
<param name="charting.myBrush.dashSpacing">10</param>
<param name="charting.myBrush.color">0xFF0000</param>
<param name="charting.myBrush.thickness">5</param>
<param name="charting.myBrush2">solidStroke</param>
<param name="charting.myBrush2.color">0x00FF00</param>
<param name="charting.myBrushPalette">list</param>
<param name="charting.myBrushPalette.brushes">[@myBrush,@myBrush2]</param>
<param name="charting.chart.lineBrushPalette">@myBrushPalette</param>

This will use the dotted line for the "first" series, and a green line for the "second" series, reguardless of name.
If you want more control, use the "field" palette to define the name of the series to reference a brush.

<param name="charting.myBrush">dashedStroke</param>
<param name="charting.myBrush.dashSize">10</param>
<param name="charting.myBrush.dashSpacing">10</param>
<param name="charting.myBrush.color">0xFF0000</param>
<param name="charting.myBrush.thickness">5</param>
<param name="charting.myBrush2">solidStroke</param>
<param name="charting.myBrush2.color">0x00FF00</param>
<param name="charting.myBrushPalette">field</param>
<param name="charting.myBrushPalette.fieldBrushes">{Average_Duration:@myBrush,Count:@myBrush2}</param>
<param name="charting.myBrushPalette.defaultBrushPalette">@myBrush2</param>
<param name="charting.chart.lineBrushPalette">@myBrushPalette</param>

This will establish the "count" line as the dotted line, the "Average_Duration" line as the green line, then make any other line the same green line as "Average_Duration".

immortalraghava
Path Finder

Hey bbingham. That's an excellent answer. The link "Brush Strokes" seems to be broken. Could you please update the latest one if there is any ?

0 Karma

bbingham
Builder

Updated, let me know if you have any issues.

0 Karma

Ayn
Legend

Excellent answer.

0 Karma

bbingham
Builder

I'll modify my original response to include a short walkthrough.

0 Karma

Dark_Ichigo
Builder

Im currently having trouble setting the Line Stroke, is there a Step by Step tutorial of doing so?

0 Karma

Dark_Ichigo
Builder

Iv tried that, but I really cant get to do it......Any more help would be great!

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...