Hello!
I'm trying to build a table showing the monthly averages of a calculation for "OEE" by a Machine field.
I then want to drill down on the month selected to show worst offending machine and the downtime reasons (both fields in the data).
The data is coming from DBX and therefore the date is contained in two fields "StartTime" and "StopTime" the events and not _time.
This search provides the table I need for **August**:
index=mattec MachID=roto* | where StartTime>=1564617600 AND StopTime<1567296000 AND StopTime>0
| lookup machines.csv MachID OUTPUTNEW Machine
| eval StartTime_Human=strftime(StartTime,"%a %B %d %Y %H:%M:%S"), StopTime_Human=strftime(StopTime,"%a %B %d %Y %H:%M:%S"), TotTimeHrs=TotTime/3600, DownTimeHrs=(DownTime/3600), SchedHrs=(SchedQty/ExpCycTm)/60+3
| eval OEE-A-ROTO=((TotTimeHrs)-(DownTimeHrs))/(TotTimeHrs)
| stats avg(SchedHrs) AS SchedHrsAvg, avg(OEE-A-ROTO) AS OEE-A-ROTO, sum(TotTimeHrs) AS TotTimeHrsSum BY JobID, Machine
| eval OEE-P-ROTO=SchedHrsAvg/TotTimeHrsSum
| eval OEE-ROTO=('OEE-A-ROTO'*'OEE-P-ROTO'*0.97)
| stats avg(OEE-ROTO) AS OEE by Machine
| eval OEE=round(OEE*100)."%"
Which provides this:
Machine OEE
RotoCure2 86%
RotoCure3 88%
RotoCure4 84%
RotoCure5 80%
RotoCure6 88%
What I would actually like this to be is:
Machine JAN FEB MAR APR MAY JUN JUL AUG
RotoCure2 86% 86% 86% 86% 86% 86% 86% 86%
RotoCure3 88% 84% 86% 86% 86% 86% 86% 86%
RotoCure4 84% 86% 86% 86% 86% 86% 86% 80%
RotoCure5 80% 86% 86% 86% 86% 86% 86% 80%
RotoCure6 88% 86% 86% 86% 86% 86% 86% 80%
Thanks for the help!
Cheers
John
↧