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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...