Splunk Search

Combinig two graphs into one

matansocher
Contributor

I have two graphs (I put example and their search code) and I want to display them on a single graph.
Is there a way to create that kind of graph?

1

| inputcsv MPSMilstonesCSV 
| dedup Report_Milestone 
| eval Report_Milestone1 = if((substr(Report_Milestone, 1, 1)  == "S"), substr(Report_Milestone, (len(Report_Milestone)-6), len(Report_Milestone)), Report_Milestone) 
| fieldformat TaskDeadline = strftime(TaskDeadline, "%d/%m/%Y") 
| streamstats count as milestoneNumber
| eval legend = milestoneNumber+" = "+Report_Milestone1
| table TaskDeadline Report_Milestone1 milestoneNumber legend
| chart sum(milestoneNumber) over TaskDeadline by legend

alt text

2

index=clearquest ("Project Name"=ipa_4*) 
    ("Task Type"="Enhancement A*" OR "Task Type"=Defe* OR "Task Type"=Doc*) 
    "Resolution"=* ("Severity"=*) "Task ID"=* 
| dedup "Task ID" 
| reverse 
| timechart span=1w dc("Task ID") AS sum_of_tasks_per_week by Severity 
| accum "S0-Critical" 
| accum "S1-High Impact" 
| accum "S2-Medium Impact" 
| accum "S3-Low Impact" 
| accum "S4-Unknown" 
| accum "No Value"

alt text

Thank you

0 Karma
1 Solution

somesoni2
Revered Legend

Give this a try. In dashboard panel visualization edit, add the fields from lookup (or from index) as overlay fields.

index=clearquest ("Project Name"=ipa_4*) 
     ("Task Type"="Enhancement A*" OR "Task Type"=Defe* OR "Task Type"=Doc*) 
     "Resolution"=* ("Severity"=*) "Task ID"=* 
 | dedup "Task ID" 
 | reverse 
 | timechart span=1w dc("Task ID") AS sum_of_tasks_per_week by Severity 
 | accum "S0-Critical" 
 | accum "S1-High Impact" 
 | accum "S2-Medium Impact" 
 | accum "S3-Low Impact" 
 | accum "S4-Unknown" 
 | accum "No Value"
| append [| inputcsv MPSMilstonesCSV 
 | dedup Report_Milestone 
 | eval Report_Milestone1 = if((substr(Report_Milestone, 1, 1)  == "S"), substr(Report_Milestone, (len(Report_Milestone)-6), len(Report_Milestone)), Report_Milestone) 
 | eval _time= TaskDeadline
 | streamstats count as milestoneNumber
 | eval legend = milestoneNumber+" = "+Report_Milestone1
 | chart sum(milestoneNumber) over _timeby legend]
| timechart values(*) as *

View solution in original post

somesoni2
Revered Legend

Give this a try. In dashboard panel visualization edit, add the fields from lookup (or from index) as overlay fields.

index=clearquest ("Project Name"=ipa_4*) 
     ("Task Type"="Enhancement A*" OR "Task Type"=Defe* OR "Task Type"=Doc*) 
     "Resolution"=* ("Severity"=*) "Task ID"=* 
 | dedup "Task ID" 
 | reverse 
 | timechart span=1w dc("Task ID") AS sum_of_tasks_per_week by Severity 
 | accum "S0-Critical" 
 | accum "S1-High Impact" 
 | accum "S2-Medium Impact" 
 | accum "S3-Low Impact" 
 | accum "S4-Unknown" 
 | accum "No Value"
| append [| inputcsv MPSMilstonesCSV 
 | dedup Report_Milestone 
 | eval Report_Milestone1 = if((substr(Report_Milestone, 1, 1)  == "S"), substr(Report_Milestone, (len(Report_Milestone)-6), len(Report_Milestone)), Report_Milestone) 
 | eval _time= TaskDeadline
 | streamstats count as milestoneNumber
 | eval legend = milestoneNumber+" = "+Report_Milestone1
 | chart sum(milestoneNumber) over _timeby legend]
| timechart values(*) as *

matansocher
Contributor

the answer did not give me the exact result I wanted, but it gave me a direction of how I need to cimbine the 2 queries into 1.

thank you

0 Karma

woodcock
Esteemed Legend

Your desire is to overlay the graphs semi-transparently as-is to merge the images, right?

0 Karma

matansocher
Contributor

Yes, exactly.

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...