Dashboards & Visualizations

Display target for only latest week from 12 weeks data

Auvchin
Engager

Error rate and Target - need to display Target number for latest week. onlyError rate and Target - need to display Target number for latest week. only

Hi, I have results for Error rate and Target for last 12 weeks and in visualization Target numbers are interfering with the error rate in the graph above. 

any way to project Target for only latest week from 12 weeks data and project the green line for 12 weeks ? so, it wont interfere with the error rate numbers. Splunk quire below. 

index=equipment_error reporttype=p_scada description="No case found with the expected dimensions" OR description="Flight Path Occupied" OR description="Place Position Occupied" OR description="Tray pattern does not comply" AND mark_code=TPO earliest=-12w@w1 latest=-0@w1
| eval APAL=substr(isc_id,2,2)
| append
[| search index=internal_statistics_1h earliest=-12w@w1 latest=-0w@w1
[| inputlookup internal_statistics
| where report="Throughput" AND level="step" AND step="Pallet building" AND measurement IN("Case")
| fields id
| rename id AS statistic_id]
| eval value=coalesce(value,sum_value)
| fields statistic_id value group_name location
| eval _virtual_=if(isnull(virtual),"N","Y"),_cd_=replace(_cd, ".*:", "")
| sort 0 -_time _virtual_ -"_indextime" -_cd_
| dedup statistic_id _time group_name
| fields - _virtual_ _cd_
| lookup internal_statistics id AS statistic_id OUTPUTNEW report level step measurement
| eval location=substr(location,12) , location="CaseQty".location
| timechart span=1w@1 sum(value) BY location limit=0
| addtotals]
| timechart span=1w@1 count(isc_id) as ErrorQty sum(Total) as CaseQty values(mark_code) as mark_code
| eval ErrorRate=round((ErrorQty/CaseQty)*10000,1)
| fillnull value=0 | eval Target="5"
| table _time ErrorRate Target
| where ErrorRate>0.001


Appreciate help and Thanks in Advance 


 

 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Instead of | eval Target="5" try this

| streamstats count as row
| eventstats max(row) as max
| eval Target=if(row=1 OR row=max,5,null())
| fields - row max

Then set the graph to connect when values are null

Auvchin
Engager

Thanks @ITWhisperer that worked, Very help full 

Auvchin_0-1707089424374.png

 

0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...