diff --git a/roles/wazuh/ansible-wazuh-agent/templates/var-ossec-etc-ossec-agent.conf.j2 b/roles/wazuh/ansible-wazuh-agent/templates/var-ossec-etc-ossec-agent.conf.j2
index 22f94856..9cd8d1f2 100644
--- a/roles/wazuh/ansible-wazuh-agent/templates/var-ossec-etc-ossec-agent.conf.j2
+++ b/roles/wazuh/ansible-wazuh-agent/templates/var-ossec-etc-ossec-agent.conf.j2
@@ -353,6 +353,11 @@
{% endif %}
{% else %}
{{ localfile.location }}
+ {% if localfile.format == 'json' %}
+ {% for label in localfile.label %}
+
+ {% endfor %}
+ {% endif %}
{% endif %}
{% endfor %}
@@ -371,6 +376,11 @@
{% endif %}
{% else %}
{{ localfile.location }}
+ {% if localfile.format == 'json' %}
+ {% for label in localfile.label %}
+
+ {% endfor %}
+ {% endif %}
{% endif %}
{% endfor %}
@@ -389,6 +399,11 @@
{% endif %}
{% else %}
{{ localfile.location }}
+ {% if localfile.format == 'json' %}
+ {% for label in localfile.label %}
+
+ {% endfor %}
+ {% endif %}
{% endif %}
{% endfor %}
@@ -404,6 +419,11 @@
{{ localfile.query}}
{% else %}
{{ localfile.location }}
+ {% if localfile.format == 'json' %}
+ {% for label in localfile.label %}
+
+ {% endfor %}
+ {% endif %}
{% endif %}
{% endfor %}