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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...