Read comments inline below for explanation of the search inindex=myIndex sourcetype=mySource Systems IN ("SYSTEM 1" , "SYSTEM 2" , "SYSTEM 3" , "SYSTEM 4")
| eval weekday="Wday-".strftime(_time,"%A")
| rename COMMENT as "Above will set the value as Wday-Mon instead of Mon.. and so forth for other days"
| eval EndHour=substr(time, 50, 1)
| eval EndMin=substr(time, 52, 2)
| eval time = EndHour.":".EndMin
| eval Time = " (" .EndHour. ":" .EndMin. "am)"
| eval category="CATEGORY 1"
| chart values(Time) over Systems by weekday
| rename COMMENT as "After the chart command, you will see a column for each value of weekday i.e. Wday-Mon, Wday-Tue....etc)"
| eval ExpectedTime = case(
System="SYSTEM 1", "6:30am",
System="SYSTEM 2", "6:35am",
System="SYSTEM 3", "6:45am",
System="SYSTEM 4", "6:40am"
)
| eval CurrentSLO= case(
System="SYSTEM 1", "7:15am",
System="SYSTEM 2", "7:20am",
System="SYSTEM 3", "7:10am",
System="SYSTEM 4", "7:10am"
)
| eval category="CATEGORY 1"
| table category Systems ExpectedTime CurrentSLO Wday-*
| rename ExpectedTime as "Expected Time"
| rename CurrentSLO as "Current SLO"
| rename category as "Category"
| eval hasMissingValues="false"
| rename COMMENT as "Now the foreach command will be run against each of week day fields that i.e. Wday-Mon, Wday-Tue..etc. It will than find out if there are missing values"
| foreach Wday-* [ | eval hasMissingValues=if(isnull('<<FIELD>>'),"true",hasMissingValues)]
| where hasMissingValues="true"
| rename COMMEND as "Finally, renaming the Wday-Mon to just Mon..and so forth"
| rename Wday-* as *
... View more