Dashboards & Visualizations

need timechart span=1d for 3 fields

splunkuseradmin
Path Finder

Need timechart span=1d for "_time mac ios tab" with stacked bar chart

cdr_events ( globalCallId_ClusterID="AMR" ) earliest=1/1/2019:00:00:00 latest=now()
| sort 0 + dateTimeConnect | eval durationStr=tostring(duration,"duration")
| stats min(_time) as _time list(callingPartyNumber) as callingPartyNumber list(cause_description) as cause_description list(destDeviceName) as destDeviceName list(dest_gateway) as dest_gateway max(_time) as detailLatest list(device_type) as device_type list(duration) as duration list(durationStr) as durationStr list(finalCalledPartyNumber) as finalCalledPartyNumber list(origDeviceName) as origDeviceName list(orig_gateway) as orig_gateway list(originalCalledPartyNumber) as originalCalledPartyNumber by globalCallID_callId globalCallID_callManagerId globalCallId_ClusterID
| search device_type=jabber | rename durationStr as duration
| sort 0 - _time
| fields _time destdevice origdevice

| timechart span=1d count(eval(match(destdevice,"CSF"))) as "CSFA1" count(eval(match(origdevice,"CSF"))) as "CSFB1" count(eval(match(destdevice,"TCT"))) as "TCTA1" count(eval(match(origdevice,"TCT"))) as "TCTB1" count(eval(match(destdevice,"TAB"))) as "TABA1" count(eval(match(origdevice,"TAB"))) as "TABB1" cont=f
| eval CSF=0,TCT=0,TAB=0
| foreach CSF* [| eval Mac=CSF+<>]
| foreach TCT* [| eval iOS=TCT+<>]
| foreach TAB* [| eval TAB=TAB+<>]
| fields _time Mac iOS TAB

I am getting a bar chart but only for mac not for ios and tab. if i try to format y-axis=log and general to side-by-side per day bars are working but not stacked bars

Tags (1)
0 Karma

renjith_nair
Legend

@splunkuseradmin,

span in timechart splits the data across the time unit you specify and it just depends on _time for timechart .

In your case, if you are able to see the data when you select logarithmic scale, then most probably count for ios and tab considerably low compared to count for Mac (scaling is linear ). You can verify that by looking at the statistics tab. Also the legends on the side of your chart should be visible for all fields.
In addition to that, you can not use logarithmic scaling and stacked chart together. In short, your search is fine, just verify the count for ios &tab

Here is a run anywhere search written in same way as yours

index=_internal earliest=-5m|timechart count(eval(sourcetype=="splunkd")) as splunkd,count(eval(sourcetype=="splunkd_access")) as splunkd_access,count(eval(sourcetype=="splunkd_ui_access")) as splunkd_ui_access
---
What goes around comes around. If it helps, hit it with Karma 🙂
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!

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...

Laser Bananas and Edge Hubs: Exploring Operational Technology (OT) Data Through a ...

  OT is a different environment to traditional IT and can have interesting challenges when interfacing the ...

Event Series: Mastering AI Tokenomics and Splunk Agent Observability

Beyond the Black Box: Correlating AI Performance and Tokenomics with Splunk Agent Observability   As ...