Hi, I am new to Splunk and working with parking records. I am calculating the current wait_time based off upcoming parking expiry times. Within my monitored data each record has the following fields: arrival_time, the time data was created, which is when the car parked permit_expiry, which is a couple of hours after the creation time parking_space, which is a number between 1 and 99, that doesn't repeat until the permit_expiry has passed. I have the steps I wish to use to display this, but am unsure how to construct a query to achieve the result. Check how many parking_space are curently in use (which should be a number between 0 & 99): sourcetype="parking_log" | where permit_expiry > now() | stats count by parking_space Find the next 5 earliest upcoming permit_expiry times and minus them from the current time. | where permit_expiry > now() limit=5 | for each permit_expiry: num_minutes=permit_expiry-arrival_time If the number of used parking_space is less than 99, for each parking_space that is free (98,97,96) replace the latest permit_expiry time with 0. if the count(parking_space) is less than 94 than all 5 numbers between 0 display the average of the five numbers (which may include both 0s and the calcluated num_minutes. Many thanks!
... View more