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!

Splunk Training for All: Meet Aspiring Cybersecurity Analyst, Marc Alicea

Splunk Education believes in the value of training and certification in today’s rapidly-changing data-driven ...

Investigate Security and Threat Detection with VirusTotal and Splunk Integration

As security threats and their complexities surge, security analysts deal with increased challenges and ...

Observability Highlights | January 2023 Newsletter

 January 2023New Product Releases Splunk Network Explorer for Infrastructure MonitoringSplunk unveils Network ...