add localfile labels to agent ossec.conf template
This change enables generating a stanza such as
```
<localfile>
<location>/var/log/myapp/log.json</location>
<log_format>json</log_format>
<label key="@source">myapp</label>
<label key="agent.type">webserver</label>
</localfile>
```
from the `wazuh_agent_config` snippet:
```
- format: json
location: /var/log/myapp/log.json
label:
- key: "@source"
value: "myapp"
- key: "agent.type"
value: "webserver"
```
This commit is contained in:
parent
a97673c6b2
commit
df46716a9b
@ -353,6 +353,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<location>{{ localfile.location }}</location>
|
<location>{{ localfile.location }}</location>
|
||||||
|
{% if localfile.format == 'json' %}
|
||||||
|
{% for label in localfile.label %}
|
||||||
|
<label key="{{ label.key }}">{{ label.value }}</label>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</localfile>
|
</localfile>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -371,6 +376,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<location>{{ localfile.location }}</location>
|
<location>{{ localfile.location }}</location>
|
||||||
|
{% if localfile.format == 'json' %}
|
||||||
|
{% for label in localfile.label %}
|
||||||
|
<label key="{{ label.key }}">{{ label.value }}</label>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</localfile>
|
</localfile>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -389,6 +399,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<location>{{ localfile.location }}</location>
|
<location>{{ localfile.location }}</location>
|
||||||
|
{% if localfile.format == 'json' %}
|
||||||
|
{% for label in localfile.label %}
|
||||||
|
<label key="{{ label.key }}">{{ label.value }}</label>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</localfile>
|
</localfile>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -404,6 +419,11 @@
|
|||||||
<query>{{ localfile.query}}</query>
|
<query>{{ localfile.query}}</query>
|
||||||
{% else %}
|
{% else %}
|
||||||
<location>{{ localfile.location }}</location>
|
<location>{{ localfile.location }}</location>
|
||||||
|
{% if localfile.format == 'json' %}
|
||||||
|
{% for label in localfile.label %}
|
||||||
|
<label key="{{ label.key }}">{{ label.value }}</label>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</localfile>
|
</localfile>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user