> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Anomaly Detector Usage

> You can detect anomalies in log records with the anomaly detector. You can examine time-based data with queries and filters to detect anomalies that reach threshold values and define actions in case of anomalies.

## Creating General Definition Information for Anomaly Detector

In the first stage, the identifying information of the job is entered. The most important field here is the **environment** information option. Queries and filters are executed on the log server in the selected environment information.

<img src="https://mintcdn.com/apinizer/dFbH01SUoq22QySj/images/tutorials/api-izleme/anomali1.png?fit=max&auto=format&n=dFbH01SUoq22QySj&q=85&s=f9442d133f999d2909e9907d6500cbef" alt="General Definition Information for Anomaly Detector" width="1000" data-path="images/tutorials/api-izleme/anomali1.png" />

## Creating Query

A query is created by combining specific fields (HTTP Method, Error Type, etc.) that will match log records with criteria of **and** / **or** / **not** types to create expected conditions.

To create a new query, it is created from the **Query** section.

<img src="https://mintcdn.com/apinizer/dFbH01SUoq22QySj/images/tutorials/api-izleme/sorgu.png?fit=max&auto=format&n=dFbH01SUoq22QySj&q=85&s=be88c56620266f3d20a5074af366aaf6" alt="Query Creation Screen" width="800" data-path="images/tutorials/api-izleme/sorgu.png" />

When the **Save** button is clicked, the created query is added to the job being defined.

<img src="https://mintcdn.com/apinizer/dFbH01SUoq22QySj/images/tutorials/api-izleme/sorgu-olusturma-ekrani.png?fit=max&auto=format&n=dFbH01SUoq22QySj&q=85&s=1790315b37edbfaf2f0a26dcc4ad4902" alt="Query Creation Screen" width="1000" data-path="images/tutorials/api-izleme/sorgu-olusturma-ekrani.png" />

<Tip>
  To go to the **Queries** screen where all queries are managed and get detailed information, [click here.](/en/analytic/query-editor/queries)
</Tip>

## Creating Filter

Filters are applied together with queries. They contain the criteria that log records will match.

To create a new filter, it is **created** from the **Filter** section.

<img src="https://mintcdn.com/apinizer/dFbH01SUoq22QySj/images/tutorials/api-izleme/filtre.png?fit=max&auto=format&n=dFbH01SUoq22QySj&q=85&s=ab47dead2b56a27bcdde69d7ed263302" alt="Filter Creation Screen" width="1000" data-path="images/tutorials/api-izleme/filtre.png" />

When the **Save** button is clicked, the created filter is added to the job being defined.

<img src="https://mintcdn.com/apinizer/dFbH01SUoq22QySj/images/tutorials/api-izleme/filtre-olusturma-ekrani.png?fit=max&auto=format&n=dFbH01SUoq22QySj&q=85&s=f6ee8c3b8dfe8a265a6aa1f1f4241b3e" alt="Filter Creation Screen" width="1000" data-path="images/tutorials/api-izleme/filtre-olusturma-ekrani.png" />

<Tip>
  To go to the **Filters** screen where all filters are managed and get detailed information, [click here.](/en/analytic/query-editor/filters)
</Tip>

## Conditions

In the following condition, **'count of documents'** will look at the request count. It will check if there is an increase of more than **"50%"** compared to the average.

In this case, the **"'1 Result'"** expression indicates that if the anomaly occurs only once, it will be considered as an anomaly.

<img src="https://mintcdn.com/apinizer/dFbH01SUoq22QySj/images/tutorials/api-izleme/conditions-ayarlari.png?fit=max&auto=format&n=dFbH01SUoq22QySj&q=85&s=78b8887e06ffb0e7e26240cd1fef57d8" alt="Conditions Settings" width="1000" data-path="images/tutorials/api-izleme/conditions-ayarlari.png" />

## Actions

When anomaly detection is performed, we can create an alert system. In this example, we will make it send an email when an anomaly occurs.

<img src="https://mintcdn.com/apinizer/dFbH01SUoq22QySj/images/tutorials/api-izleme/actions-mail-ayarlari.png?fit=max&auto=format&n=dFbH01SUoq22QySj&q=85&s=a7e3066826e5968ea93e5d5ddc8a4478" alt="Actions Mail Settings" width="1000" data-path="images/tutorials/api-izleme/actions-mail-ayarlari.png" />

In the **'Server'** field, you can add new mail connection information or select an existing one. The **address**, **subject**, and **message** to which the email will be sent are entered and saved.

<img src="https://mintcdn.com/apinizer/dFbH01SUoq22QySj/images/tutorials/api-izleme/server.png?fit=max&auto=format&n=dFbH01SUoq22QySj&q=85&s=31a9c2e1ff55252f137a0d40fd3e18ff" alt="Actions Mail Form" width="1000" data-path="images/tutorials/api-izleme/server.png" />

<Tip>
  To get information about action types, action usage, and variables within tasks, [click here.](/en/concepts/core-concepts/connector)
</Tip>

## Save

In the final state, the information will appear as follows, and let's make it ready for monitoring with the save button.

<img src="https://mintcdn.com/apinizer/dFbH01SUoq22QySj/images/tutorials/api-izleme/kaydet-son-durum.png?fit=max&auto=format&n=dFbH01SUoq22QySj&q=85&s=99d67a9bc15f530ffa64c712a7aba8e0" alt="Save Final State" width="1000" data-path="images/tutorials/api-izleme/kaydet-son-durum.png" />

## Examining Job Details

You can check with the **Result** option.

<img src="https://mintcdn.com/apinizer/dFbH01SUoq22QySj/images/tutorials/api-izleme/monitor-kaydi-detay.png?fit=max&auto=format&n=dFbH01SUoq22QySj&q=85&s=cebc297ee778c0f0bd406bdcb3222e48" alt="Monitor Record Detail" width="1000" data-path="images/tutorials/api-izleme/monitor-kaydi-detay.png" />

If an error has been received, it may be necessary to find the reason, or if you want to examine the general log records of the process and filter on them, the detail page of the monitor record should be visited.

Detailed information can be obtained by clicking the detail icon in the relevant log record.

<img src="https://mintcdn.com/apinizer/dFbH01SUoq22QySj/images/tutorials/api-izleme/log-kaydi-detay.png?fit=max&auto=format&n=dFbH01SUoq22QySj&q=85&s=334b05ab8bbe0ab0e57b71f579129c16" alt="Log Record Detail" width="1000" data-path="images/tutorials/api-izleme/log-kaydi-detay.png" />
