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
Revered Legend

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
Revered Legend

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 ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...