Cannot filter by session/id in Application Insights API

Michael S. Scherotter 26 Reputation points
2023-01-21T02:18:46.8866667+00:00

The Application Insights REST API seems to let me search for custom events by session/id.

A URL like this returns 0 values:

https://api.applicationinsights.io/v1/apps/my_app_id/events/customEvents?$filter='session/id' eq '5Ir7eEKoMoRwsg6jpnX2j'&$top=500&$skip=0×pan=P2Y

User's image

knowing that i got the session/id from a previous call which showed the custom event with that session/id. I have no problem filtering by other fields, but I get no results when filtering by session/id Please advise.

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,812 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AnuragSingh-MSFT 20,106 Reputation points
    2023-03-24T04:34:26.6966667+00:00

    @Michael S. Scherotter , Apologies for the delayed response.

    After working through this issue with the AppInsights team, I found that the issue was related to syntax. Please remove quotes (') from the $filter expression's first operand. Therefore, the expression

    $filter='session/id' <changes to> $filter=session/id

    The complete URL will be as below (note the absence of quotes around session/id)

    https://api.applicationinsights.io/v1/apps/my_app_id/events/customEvents?$filter=session/id eq '5Ir7eEKoMoRwsg6jpnX2j'&$top=500&$skip=0×pan=P2Y

    Hope this helps. Please let me know if you have any questions.

    0 comments No comments