Given public transit log data of the form:
2016-08-01 13:34:03 GMT vehicle_id="1234" stop_id="5678"
I would like to calculate (and plot) the following:
FYI: I also have a transforms.conf
and a props.conf
that, based on the stop_id
, looks up the stop's stop_name
, stop_lat
(latitude), and stop_lon
(longitude).
Try this run anywhere command (for your data, just use the portion starting with | streamstats).
| gentimes start=-1 increment=5m | eval vehicle_id=random()%10 |eval stop_id=random()%10 | eval _time=starttime |streamstats global=f window=2 range(_time) AS wait by stop_id | eval wait=wait/60 | chart avg(wait) max(wait) by stop_id
And for a timechart:
| gentimes start=-1 increment=5m | eval vehicle_id=random()%10 |eval stop_id=random()%10 | eval _time=starttime |streamstats global=f window=2 range(_time) AS wait by stop_id | eval wait=wait/60 | timechart avg(wait) max(wait) by stop_id
Try this run anywhere command (for your data, just use the portion starting with | streamstats).
| gentimes start=-1 increment=5m | eval vehicle_id=random()%10 |eval stop_id=random()%10 | eval _time=starttime |streamstats global=f window=2 range(_time) AS wait by stop_id | eval wait=wait/60 | chart avg(wait) max(wait) by stop_id
And for a timechart:
| gentimes start=-1 increment=5m | eval vehicle_id=random()%10 |eval stop_id=random()%10 | eval _time=starttime |streamstats global=f window=2 range(_time) AS wait by stop_id | eval wait=wait/60 | timechart avg(wait) max(wait) by stop_id