Retrieve a list of events.
Use the query parameter to filter events on key/value criteria. The queryFields parameter can be used in combination with query to specify which fields to filter events by.
Syntax:
key:value: matches events with metadata that contains a key namedkeywith a value ofvalue; use double quotes if the value contains spaces or special characterskey:value1,value2: matches events with metadata that contains a key namedkeywith a value of eithervalue1orvalue2key:*: matches events where any metadata that contains a key namedkey*:value: matches events where any metadata that containsvalueas a valuefoo: matches events with metadata where any key or value string containsfoo
Multiple qualifiers can be used in the same query string; this will filter events where metadata matches the intersection of the qualifiers (AND).
Examples:
key1:value1 key2:value2: matches metadata that contains both a key namedkey1with its valuevalue1and another key namedkey2with its valuevalue2key:"value with spaces": matches metadata with a key namedkeyand its valuevalue with spaceskey:value foo: matches metadata that contains both a key namedkeywith its valuevalueand any key or value that contains the textfoo
Note: The
startandendquery arguments will find any events which intersect the query range (inclusive of start and end).
Security
ApiKey(Required scopes: events.list)
- Productionhttps://api.foxglove.dev/v1/events
from foxglove.client import Client
from datetime import datetime, timedelta
token = "<YOUR API TOKEN HERE>"
client = Client(token=token)
client.get_events(
device_id=device_id,
sort_by=sort_by,
sort_order=sort_order,
limit=limit,
offset=offset,
start=datetime.now() - timedelta(hours=3),
end=datetime.now() - timedelta(hours=1),
query="key:val"
)
A list of device events
Array []
A key-value map of the custom properties associated with this event.
Response
[ { "id": "string", "start": "2019-08-24T14:15:22Z", "end": "2019-08-24T14:15:22Z", "deviceId": "string", "device": { … }, "metadata": {}, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "eventTypeId": "string", "properties": { … } } ]