Skip to content
This is an archived version of the documentation downloaded from LogScale Documentation Archives. Up to date documentation, and documentation for later versions, is available on LogScale Documentation

## `eventFieldCount()`

Computes the number of fields that this event uses internally for the values. Tags are not fields in most cases.

Parameter | Type | Required | Default Value | Description
--- | --- | --- | --- | ---
`as` | string | optional[a] | `_eventFieldCount` | Name of output field.
[a] Optional parameters use their default value unless explicitly set.

### `eventFieldCount()` Examples

Click + next to an example below to get the full details.

#### Search For Events by Number of Fields in Repository

Search for events with a certain number of fields in a repository using `eventFieldCount()` function

##### Query

logscale

    eventFieldCount()
    | _eventFieldCount <  6

##### Introduction

The `eventFieldCount()` function is used to search for events depending on the number of fields on the event. The `eventFieldCount()` function augments the event data with the event field count information.

##### Step-by-Step

1. Starting with the source repository events.

2. logscale

       eventFieldCount()

   Determines the number of fields that events has, and returns the results in a field named _eventFieldCount.

3. logscale

       | _eventFieldCount <  6

   Searches for events that has fewer than 6 fields. Notice that you cannot do a direct comparison, as the function augments the event data with the event field count information, rather than returning data.

4. Event Result set.

##### Summary and Results

The query is used to get an overview of the event with a low field count.

#### Enter search term