<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://www.xinux.net/index.php?action=history&amp;feed=atom&amp;title=Wazuh_Logging_Cheat-Sheet</id>
	<title>Wazuh Logging Cheat-Sheet - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://www.xinux.net/index.php?action=history&amp;feed=atom&amp;title=Wazuh_Logging_Cheat-Sheet"/>
	<link rel="alternate" type="text/html" href="https://www.xinux.net/index.php?title=Wazuh_Logging_Cheat-Sheet&amp;action=history"/>
	<updated>2026-09-11T13:27:09Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Xinux Wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://www.xinux.net/index.php?title=Wazuh_Logging_Cheat-Sheet&amp;diff=73358&amp;oldid=prev</id>
		<title>Thomas.will: Die Seite wurde neu angelegt: „=Wazuh Logging — Cheat Sheet= Wo was liegt und womit man nachsieht, wenn im Dashboard nichts ankommt.  Jeder Abschnitt ist einer Maschine zugeordnet: * '''[A…“</title>
		<link rel="alternate" type="text/html" href="https://www.xinux.net/index.php?title=Wazuh_Logging_Cheat-Sheet&amp;diff=73358&amp;oldid=prev"/>
		<updated>2026-09-09T10:10:21Z</updated>

		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: „=Wazuh Logging — Cheat Sheet= Wo was liegt und womit man nachsieht, wenn im Dashboard nichts ankommt.  Jeder Abschnitt ist einer Maschine zugeordnet: * &amp;#039;&amp;#039;&amp;#039;[A…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Wazuh Logging — Cheat Sheet=&lt;br /&gt;
Wo was liegt und womit man nachsieht, wenn im Dashboard nichts ankommt.&lt;br /&gt;
&lt;br /&gt;
Jeder Abschnitt ist einer Maschine zugeordnet:&lt;br /&gt;
* '''[A]''' = auf dem Agenten (z.B. www, waf)&lt;br /&gt;
* '''[M]''' = auf dem Manager (wazuh.dkbi.com)&lt;br /&gt;
&lt;br /&gt;
== Wo liegt was ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Datei !! Maschine !! Inhalt&lt;br /&gt;
|-&lt;br /&gt;
| ''/var/ossec/logs/ossec.log'' || A + M || Betriebsmeldungen der Dienste. Der einzige Log auf der Agent-Seite&lt;br /&gt;
|-&lt;br /&gt;
| ''/var/ossec/logs/alerts/alerts.json'' || M || Alles, was eine Regel getroffen hat&lt;br /&gt;
|-&lt;br /&gt;
| ''/var/ossec/logs/alerts/alerts.log'' || M || Dasselbe im Klartext&lt;br /&gt;
|-&lt;br /&gt;
| ''/var/ossec/logs/archives/archives.json'' || M || '''Alles''', auch ohne Regeltreffer — nur bei aktivem ''logall_json''&lt;br /&gt;
|-&lt;br /&gt;
| ''/var/ossec/logs/active-responses.log'' || A || Ausgeführte Active Responses&lt;br /&gt;
|}&lt;br /&gt;
'''Merksatz:''' Der Agent liest und sendet, er führt keine Buchhaltung. Was gesendet wurde, sieht man nur auf dem Manager.&lt;br /&gt;
&lt;br /&gt;
== [A] Agent — was wird eingelesen ==&lt;br /&gt;
;Welche Dateien überwacht der Logcollector?&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep &amp;quot;Analyzing file&amp;quot; /var/ossec/logs/ossec.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
;Konfiguration testen, bevor neu gestartet wird&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/var/ossec/bin/wazuh-logcollector -t&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
;Jede gelesene Zeile sehen — in ''/var/ossec/etc/local_internal_options.conf''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
logcollector.debug=2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
systemctl restart wazuh-agent&lt;br /&gt;
tail -f /var/ossec/logs/ossec.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Danach wieder auf ''0'' setzen.&lt;br /&gt;
;Verbindung zum Manager&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep -E &amp;quot;Connected to the server|Unable to connect&amp;quot; /var/ossec/logs/ossec.log | tail -5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [M] Manager — was kommt an ==&lt;br /&gt;
;Agentenliste mit Status&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/var/ossec/bin/agent_control -l&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
;Lauscht der Manager?&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ss -lnup | grep 1514&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
;Dienste&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/var/ossec/bin/wazuh-control status&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
;Konfiguration prüfen, ohne neu zu starten&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/var/ossec/bin/wazuh-analysisd -t&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [M] Live mitlesen ==&lt;br /&gt;
;Alerts&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/ossec/logs/alerts/alerts.json | jq -c '[.agent.name, .rule.id, .rule.description]'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
;Alles, auch ohne Treffer — vorher in ''/var/ossec/etc/ossec.conf'' im ''&amp;lt;global&amp;gt;''-Block&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;logall_json&amp;gt;yes&amp;lt;/logall_json&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
systemctl restart wazuh-manager&lt;br /&gt;
tail -f /var/ossec/logs/archives/archives.json | jq -c '[.agent.name, .decoder.name, .rule.id // &amp;quot;-&amp;quot;, .full_log]'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Achtung:''' Archives werden nicht rotiert. Nach der Übung wieder auf ''no''.&lt;br /&gt;
;Nach einem Agenten filtern&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -f /var/ossec/logs/archives/archives.json | jq -c 'select(.agent.name==&amp;quot;www&amp;quot;) | .full_log'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [M] Regeln und Decoder testen ==&lt;br /&gt;
;Interaktiv — Logzeile reinpasten, Ergebnis sofort&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/var/ossec/bin/wazuh-logtest&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Phase 1: Vordekodierung (Zeitstempel, Hostname)&lt;br /&gt;
* Phase 2: Decoder und extrahierte Felder&lt;br /&gt;
* Phase 3: Regel-ID und Level — bleibt leer, wenn keine Regel greift&lt;br /&gt;
;Aus einer Datei heraus&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tail -1 /var/log/coraza/audit.log | /var/ossec/bin/wazuh-logtest&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
;Regeln auf Dopplungen prüfen — doppelte IDs verhindern den Start des Managers&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep -rn 'rule id=&amp;quot;1001' /var/ossec/etc/rules/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Typische Ursachen ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Symptom !! Prüfen auf !! Ursache&lt;br /&gt;
|-&lt;br /&gt;
| Gar nichts im ossec.log zur Datei || A || ''&amp;lt;localfile&amp;gt;'' fehlt oder Pfad falsch&lt;br /&gt;
|-&lt;br /&gt;
| HTTP wird geloggt, HTTPS nicht || A || SSL-vhost schreibt in ''ssl_access.log''&lt;br /&gt;
|-&lt;br /&gt;
| Datei da, aber keine Zeilen || A || Angriff kam '''vor''' dem Agent-Neustart — nur Neues wird gelesen&lt;br /&gt;
|-&lt;br /&gt;
| In archives.json, aber kein Alert || M || Keine Regel greift. Mit ''wazuh-logtest'' gegenprüfen&lt;br /&gt;
|-&lt;br /&gt;
| Manager startet nicht || M || Doppelte Regel-ID oder XML-Fehler — steht im ossec.log&lt;br /&gt;
|-&lt;br /&gt;
| Nichts erscheint, obwohl alles stimmt || — || Zu wenig Verkehr. Mit einer Schleife 20 Requests erzeugen&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Nach der Übung aufräumen ==&lt;br /&gt;
;[A] in ''local_internal_options.conf''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
logcollector.debug=0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
;[M] in ''ossec.conf''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;logall_json&amp;gt;no&amp;lt;/logall_json&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Kategorie:WAZUH]]&lt;/div&gt;</summary>
		<author><name>Thomas.will</name></author>
	</entry>
</feed>