Question about API Filtering

Might be a stupid question with the Sensu Go API filtering stuff…
I’m trying to do a request to get only keepalive events. So I try something like this:

curl -H "Authorization: Bearer $SENSU_ACCESS_TOKEN" http://192.168.1.34:8080/api/core/v2/namespaces/default/events -G --data-urlencode 'fieldSelector=check.name == "keepalive"'
[]

But I do not get any result…Still when I’m not using any filter, I can see I have keepalive events:

curl -H "Authorization: Bearer $SENSU_ACCESS_TOKEN" http://192.168.1.34:8080/api/core/v2/namespaces/default/events -| jq .[].check.metadata.name"keepalive"
"linux-load-utilisation"
"keepalive"
"linux-load-utilisation"

Can anyone spot what did I do wrong with the fieldSelector?

Since you are hitting the /events API endpoint, you need to use the event field selector event.check.name.

List of field selectors

1 Like