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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...