Count Events From Each Datasource

Count events from each datasource by using eventInternals() function to add storage location to each event

Query

logscale
eventInternals()
| groupBy([@datasourceId])

Introduction

The eventInternals() function is used to add the storage locations of this event. The eventInternals() function augments the event data with the event field count information.

Step-by-Step

  1. Starting with the source repository events.

  2. logscale
    eventInternals()

    Adds a @datasourceId field describing the storage locations of the event.

  3. logscale
    | groupBy([@datasourceId])

    Groups the events based on the @datasourceId, performs a count of the events and returns the results in a _count field.

  4. Event Result set.

Summary and Results

The query is used to find the number of events per datasource.