Splunk Enterprise Security

Timechart command and changing Visualization colors

Hegemon76
Communicator

Hello,

I think I've very close to getting this working.....but having issues with the eval command for some reason? Can't seem to figure out why and the error doesn't give me much to go on....

Basically just trying to get different colors into the horizontal barchart.

product=Windows EventCode=645 OR EventCode=4741 | timechart span=1w count | eval Severe=if(count>25,count,0) | eval High=if(count<=25 AND count>20,count,0) |eval Moderate=if(count<=20 AND count>15,count,0) | eval Low=if(count<=15, count>7,count, 0) | eval Very_Low=if(count<=7, count=>0,count, 0) |convert timeformat="%Y-%m-%d" ctime(Date)| rename _time as Date, count as Count

XML

    <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
    <option name="charting.fieldColors">{"Severe":0xFF0000,"High":0xff8000,"Moderate":0xFFFF00,"Low":0x00FF00,"Very Low":0x0000ff}</option>
    <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>

Thanks!

0 Karma
1 Solution

Hegemon76
Communicator

Answered my own question but a different issue appeared! I was missing two operators in the search string and adjusted the "count=>0" to "count>0"

product=Windows EventCode=645 OR EventCode=4741 | timechart span=1w count | eval Severe=if(count>25,count,0) | eval High=if(count<=25 AND count>20,count, 0)| eval Moderate = if(count<=20 AND count>15,count,0) | eval Low = if(count<=15 AND count>7,count, 0) | eval Very Low = if(count<=7 AND count>0,count, 0)| rename _time as Date, count as Count |convert timeformat="%Y-%m-%d" ctime(Date)

Since I can't post pictures this is going to be difficult....

In the graph I have the colors and information I want however there is also the "count" field for obvious reasons (it is a timechart). I suppose there is no way to get rid of that?

View solution in original post

0 Karma

Hegemon76
Communicator

Answered my own question but a different issue appeared! I was missing two operators in the search string and adjusted the "count=>0" to "count>0"

product=Windows EventCode=645 OR EventCode=4741 | timechart span=1w count | eval Severe=if(count>25,count,0) | eval High=if(count<=25 AND count>20,count, 0)| eval Moderate = if(count<=20 AND count>15,count,0) | eval Low = if(count<=15 AND count>7,count, 0) | eval Very Low = if(count<=7 AND count>0,count, 0)| rename _time as Date, count as Count |convert timeformat="%Y-%m-%d" ctime(Date)

Since I can't post pictures this is going to be difficult....

In the graph I have the colors and information I want however there is also the "count" field for obvious reasons (it is a timechart). I suppose there is no way to get rid of that?

0 Karma

niketn
Legend

@Hegemon76, I have converted your comment to answer. Please accept the same to mark this question as answered!

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

Hegemon76
Communicator

I believe I have accepted!

0 Karma

Anam
Community Manager
Community Manager

Hi @Hegemon

It is great you were able to answer your question! Please post the answer here so the rest of the community can benefit from it. Also please post your second question as a new question so you can get maximum exposure on it.

Thanks!

0 Karma

Hegemon76
Communicator

I did post my answer.

I will make another question. Thanks!

0 Karma
Get Updates on the Splunk Community!

The OpenTelemetry Certified Associate (OTCA) Exam

What’s this OTCA exam? The Linux Foundation offers the OpenTelemetry Certified Associate (OTCA) credential to ...

From Manual to Agentic: Level Up Your SOC at Cisco Live

Welcome to the Era of the Agentic SOC   Are you tired of being a manual alert responder? The security ...

Splunk Classroom Chronicles: Training Tales and Testimonials (Episode 4)

Welcome back to Splunk Classroom Chronicles, our ongoing series where we shine a light on what really happens ...