# Monitoring-Konfiguration

### Voraussetzungen

Bevor Netacea Ihre Plattform erfolgreich überwachen kann, stellen Sie bitte sicher, dass Sie Folgendes bereitgestellt haben:

1. Eine Liste aller bekannten, sicheren und vertrauenswürdigen Benutzer, Partner und Drittanbieter-Apps. Dies umfasst eine Liste vertrauenswürdiger Bots und automatisierter Tools. Informationen über bekannte böswillige Akteure sind ebenfalls wertvoll.
2. Eine Liste der Schutz-Anwendungsfälle und der Pfade, die für jeden anfällig sind.
3. Die relevanten Log-Shipping-Endpunkte und Anmeldedaten wurden über das [Netacea-Portal](/de/netacea-plugin-informationen/accessing-your-integration-settings.md) geteilt.

### Implementierungsschritte für Log-Streaming

* Melden Sie sich bei der Fastly/Magento-Weboberfläche an.
* Navigieren Sie zu Stores → Konfiguration → Erweitert → System → Full Page Cache → Fastly Configuration → Tools → Real Time Log Streaming.
* Erstellen Sie einen neuen Real-Time-Log-Streaming-Job, indem Sie auf „Create" bei Create Endpoint klicken, Amazon S3 auswählen und auf „Add" klicken.

<figure><img src="/files/xqDpW50www7cjuhYnjWs" alt=""><figcaption></figcaption></figure>

* Füllen Sie den Log-Streaming-Job mit den folgenden Informationen aus:

XLOCKX91\`\`\` {"@timestamp": "%{%Y-%m-%dT%H:%M:%S%z}t","bc\_type": %{if(req.http.netacea\_bctype\_string, "%u0022" + json.escape(req.http.netacea\_bctype\_string) + "%u0022", "null")}V,"bytes\_sent": "%B","cookie\_session\_status": %{if(req.http.x-netacea:cookie\_session\_status, "%u0022" + json.escape(req.http.x-netacea:cookie\_session\_status) + "%u0022", "null")}V,"client": "%{json.escape(client.ip)}V","domain": %{if(req.http.host, "%u0022" + json.escape(req.http.host) + "%u0022", "null")}V,"integration\_mode": %{"%u0022" + json.escape(req.http.x-netacea:integration\_mode) + "%u0022"}V,"integration\_type": %{if(req.http.integration\_type, "%u0022" + json.escape(req.http.integration\_type) + "%u0022", "null")}V,"integration\_version": %{if(req.http.integration\_version, "%u0022" + json.escape(req.http.integration\_version) + "%u0022", "null")}V,"method": "%{json.escape(req.method)}V","path": "%{json.escape(req.url.path)}V","mit\_svc\_latency":%{if(req.http.x-netacea:mit\_svc\_latency, "%u0022" + json.escape(req.http.x-netacea:mit\_svc\_latency) + "%u0022", "0")}V,"mit\_status":%{if(req.http.x-netacea:mit\_status, "%u0022" + json.escape(req.http.x-netacea:mit\_status) + "%u0022", "0")}V,"protocol": "%{json.escape(req.proto)}V","query": "%{json.escape(req.url.qs)}V","referrer": %{if(req.http.referer, "%u0022" + json.escape(req.http.referer) + "%u0022", "null")}V,"request\_time": %{time.elapsed}V,"status": "%{json.escape(resp.status)}V","user\_agent": %{if(req.http.user-agent, "%u0022" + json.escape(req.http.user-agent) + "%u0022", "null")}V,"user\_id": %{if(req.http.x-netacea-userid, "%u0022" + json.escape(req.http.x-netacea-userid) + "%u0022", "null")}V,"client\_ja3\_md5": %{if(tls.client.ja3\_md5, "%u0022" + json.escape(tls.client.ja3\_md5) + "%u0022", "null")}V,"x\_forwarded\_for": %{if(req.http.X-Forwarded-For, "%u0022" + json.escape(req.http.X-Forwarded-For) + "%u0022", "null")}V} \`\`\`92XLOCKXXLOCKX9798XLOCKX

<table><thead><tr><th width="216">Feld</th><th>Wert</th></tr></thead><tbody><tr><td>Name</td><td>Geben Sie einen einprägsamen, lesbaren Namen für den Endpunkt ein, z. B. Netacea_Logging.</td></tr><tr><td>Log Format</td><td><a href="#log-format">Log Format</a></td></tr><tr><td>Timestamp</td><td><a href="#undefined">Timestamp</a></td></tr><tr><td>Bucket Name</td><td>Der von Netacea bereitgestellte Name</td></tr><tr><td>Access Key</td><td>Der von Netacea bereitgestellte Zugriffsschlüssel</td></tr><tr><td>Secret Key</td><td>Der von Netacea bereitgestellte geheime Schlüssel</td></tr><tr><td>Path</td><td>Der von Netacea bereitgestellte Pfad</td></tr><tr><td>Domain</td><td>s3.eu-west-1.amazonaws.com</td></tr><tr><td>Log Line Format</td><td>Leer</td></tr><tr><td>Compression</td><td>Gzip</td></tr><tr><td>GZIP Level</td><td></td></tr><tr><td>Period</td><td></td></tr></tbody></table>

{% hint style="warning" %}
Wenn Shielding für Fastly-Host(s) aktiviert ist, lesen Sie bitte den folgenden Abschnitt „Shielding-Hinweise", bevor Sie einen Logging-Endpunkt erstellen.
{% endhint %}

<figure><img src="/files/LZhJuwcdfM9puusT1svM" alt=""><figcaption></figcaption></figure>

#### **Log Format**

{% code overflow="wrap" %}

```
{"@timestamp": "%{%Y-%m-%dT%H:%M:%S%z}t","bc_type": %{if(req.http.netacea_bctype_string, "%u0022" + json.escape(req.http.netacea_bctype_string) + "%u0022", "null")}V,"bytes_sent": "%B","cookie_session_status": %{if(req.http.x-netacea:cookie_session_status, "%u0022" + json.escape(req.http.x-netacea:cookie_session_status) + "%u0022", "null")}V,"client": "%{json.escape(client.ip)}V","domain": %{if(req.http.host, "%u0022" + json.escape(req.http.host) + "%u0022", "null")}V,"integration_mode": %{"%u0022" + json.escape(req.http.x-netacea:integration_mode) + "%u0022"}V,"integration_type": %{if(req.http.integration_type, "%u0022" + json.escape(req.http.integration_type) + "%u0022", "null")}V,"integration_version": %{if(req.http.integration_version, "%u0022" + json.escape(req.http.integration_version) + "%u0022", "null")}V,"method": "%{json.escape(req.method)}V","path": "%{json.escape(req.url.path)}V","mit_svc_latency":%{if(req.http.x-netacea:mit_svc_latency, "%u0022" + json.escape(req.http.x-netacea:mit_svc_latency) + "%u0022", "0")}V,"mit_status":%{if(req.http.x-netacea:mit_status, "%u0022" + json.escape(req.http.x-netacea:mit_status) + "%u0022", "0")}V,"protocol": "%{json.escape(req.proto)}V","query": "%{json.escape(req.url.qs)}V","referrer": %{if(req.http.referer, "%u0022" + json.escape(req.http.referer) + "%u0022", "null")}V,"request_time": %{time.elapsed}V,"status": "%{json.escape(resp.status)}V","user_agent": %{if(req.http.user-agent, "%u0022" + json.escape(req.http.user-agent) + "%u0022", "null")}V,"user_id": %{if(req.http.x-netacea-userid, "%u0022" + json.escape(req.http.x-netacea-userid) + "%u0022", "null")}V,"client_ja3_md5": %{if(tls.client.ja3_md5, "%u0022" + json.escape(tls.client.ja3_md5) + "%u0022", "null")}V,"x_forwarded_for": %{if(req.http.X-Forwarded-For, "%u0022" + json.escape(req.http.X-Forwarded-For) + "%u0022", "null")}V}
```

{% endcode %}

#### Timestamp

```
%Y-%m-%dT%H:%M:%S.000
```

### Shielding-Hinweise

Fastly ermöglicht es Benutzern, die Host-Funktion „[Shielding](https://developer.fastly.com/learning/concepts/shielding/)" zu aktivieren, die einige Vorteile bietet, wie z. B. die Reduzierung der Origin-Last, die Verbesserung der Cache-Trefferquote usw. Die Aktivierung dieser Funktion in einem Fastly-Service, der unsere Integration verwendet, führt zu einer Duplizierung der Logs, die über das Netacea-Logging gesendet werden. Dies ist nicht beabsichtigt.\
\
Um dieses Problem zu lösen, müssen wir eine Condition an das Netacea-Logging anhängen.

* Klicken Sie auf das Zahnrad-Symbol neben dem Logging-Endpunkt

<figure><img src="/files/RPdfqviBCcUkIQjmQRHI" alt=""><figcaption></figcaption></figure>

* Suchen Sie im Popup-Fenster die Zeile „Condition" und klicken Sie auf „Attach a condition"

<figure><img src="/files/Cuyhhs1msvuCQ9dmV0xR" alt=""><figcaption></figcaption></figure>

* Danach können Sie auf „Create a new response condition" klicken

<figure><img src="/files/EWqu3DwYEgObfY8cI68K" alt=""><figcaption></figcaption></figure>

* Ein Popup-Fenster öffnet sich, in dem Sie diese Details eingeben müssen:

<table><thead><tr><th width="186">Feld</th><th>Wert</th></tr></thead><tbody><tr><td>Name</td><td>z. B. Netacea_Log_Visit</td></tr><tr><td>Apply if</td><td><code>(req.url !~ "/media/" &#x26;&#x26; req.url !~ "/static/") &#x26;&#x26; fastly.ff.visits_this_service == 0</code></td></tr><tr><td>Priority</td><td>10 (Standard)</td></tr></tbody></table>

* Klicken Sie auf „Create". Sie sollten nun sehen, dass die Condition an den Logging-Stream angehängt wurde

<figure><img src="/files/rAA4Sgos6yHzEQzCQKoJ" alt=""><figcaption></figcaption></figure>

* Jetzt können Sie erneut auf „Create" klicken, und das Logging wird entsprechend aktualisiert

### Abschluss

Überprüfen Sie, ob Sie die folgenden Schritte abgeschlossen haben:

* [Log-Streaming](#log-streaming) zum bereitgestellten S3-Bucket konfiguriert
* Stellen Sie sicher, dass keine Fehlerwarnungen angezeigt werden

Sie können nun die Bereitstellung durchführen, indem Sie auf „Save Config" klicken

{% hint style="info" %}
Manchmal ist eine Cache-Leerung erforderlich. Gehen Sie dazu zu System -> Cache Management und klicken Sie auf „Flush Magento Cache".
{% endhint %}

Das Monitoring wird nun in der Fastly/Magento-Umgebung bereitgestellt. Sie können überprüfen, ob die Bereitstellung aktiv ist, indem Sie:

* Die aktive Version auf den neuen Log-Shipping-Job überprüfen.
* Netacea bitten, die internen Ingest-Metriken zu überprüfen.
* Netacea bitten, den Dateninhalt und das Format zu validieren.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.netacea.com/de/netacea-plugin-informationen/fastly-magento/monitoring-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
