Splunk Search

How to create a stacked bar graph showing total time and (total time-pending) stacked by filter?

timgirgis
Explorer

I want to create a stacked bar graph showing 2 columns stacked by department: 1 column is the total time and the second column is the total time-(time where status = pending)

REQUIRED = "Allocated Time" where "Allocation Interval Status" = APPROVED OR PENDING
CURRENT="Allocated Time" where "Allocation Interval Status" = APPROVED
These 2 columns should show as a stacked bar graph where the stacking is done by "Employee_s Department"

alt text

1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try something like this

index=traffic_live | chart sum("Allocated Time") over "Employee_s Department" by "Allocation Interval Status" | eval REQUIRED=APPROVED+PENDING | rename APPROVED as CURRENT | table "Employee_s Department" REQUIRED CURRENT

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Try something like this

index=traffic_live | chart sum("Allocated Time") over "Employee_s Department" by "Allocation Interval Status" | eval REQUIRED=APPROVED+PENDING | rename APPROVED as CURRENT | table "Employee_s Department" REQUIRED CURRENT

timgirgis
Explorer

Thanks so much for your help, we took it from there and came up with this, which gave us what we wanted:

source="TrafficLiveAll.csv" | chart sum("Allocated Time") over "Employee_s Department" by "Allocation Interval Status" | eval REQUIRED=(APPROVED+PENDING)/480 | eval CURRENT=APPROVED/480 | table REQUIRED CURRENT | transpose | rename "row 1" as "Business Development", "row 2" as "Capacity", "row 3" as "Creative", "row 4" as "Data Consulting", "row 5" as "Development", "row 6" as "General", "row 7" as "Marketing", "row 8" as "Project Management", "row 9" as "Quality Assurance"
0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...