## Log Events

The **Log Events** panel shows log entries that match specific filters. Use it to monitor error rates, trace issues, or watch for specific application or infrastructure events in real time.

### Add a Log Events panel

1. Open the dashboard where you want the panel.
2. Click **Add Panel**.
3. In **Choose Visualization**, select **Log Events**.

4. Build your log query in **Graph your data** to define the log source and filters.
5. Enter a descriptive **Title**.
6. Click **Save** to add the panel.

### Build queries (Graph your data)

#### Build queries (Graph your data)

The **Graph your data** section defines which metrics are displayed and how they are processed before visualization. These steps apply to most panel types in Kloudfuse.

1. Click **Add Query** to create a new query. Repeat to add multiple queries.
2. Click **Select a metric** to choose the metric name you want to query.
3. Use **From** to select the metric source or namespace.
4. Click **Add Label** to filter results by label values (for example: `pod=web`, `env=prod`).
5. Select an **Aggregation** (for example: `min`, `max`, `sum`, `avg`) to reduce raw samples to one value per time interval.
6. Use the **Select** dropdown (if available) to set the aggregation interval (for example: `1m`, `5m`).
7. Click **Add Functions** to apply transformations to your data.

Common examples:
\* `rate()` — Convert counters to rates.
\* `derivative()` — Show the rate of change.
\* `moving_avg()` — Smooth short-term fluctuations.
\* `scale()` — Multiply values by a constant.

|     |     |
| --- | --- |
|  | Query order determines formula identifiers: the first query = `a`, second = `b`, etc.<br>Assign aliases to queries for more readable formulas. |

#### Add formulas

Use formulas to create new series from existing queries.

1. Click **Add Formula** in **Graph your data**.
2. Reference queries by their letter (`a`, `b`, …) or alias.
3. Enter your expression and click **Apply**.

Example — double a series:
```
2*a
```

Example — percentage change between two queries:
```
((a - b) / b) * 100
```

|     |     |
| --- | --- |
|  | - Use parentheses to control precedence: `2*(a + b)` vs. `2*a + b`.<br>  <br>- If queries return different intervals, the formula engine aligns or interpolates values.<br>  <br>- Add a **Label** so the formula appears meaningfully in the legend. |

### Log Events–specific settings

Once your log source is selected:

- **Log source** — Choose the dataset, index, or stream that stores your logs.
- **Time window** — Define the time range for displayed logs (e.g., `Last 5 minutes`, `Last 24 hours`).
- **Filters** — Apply field-based filters (for example: `level=error`, `service=api`, `pod=f*`
