Hi Miran Ul Haq
Best practice is to keep it in agent.conf, grouped by OS and centrally managed.
You need to do the following steps to troubleshoot:
1. Check if agent is not actually in the Linux group, confirm in the UI: Dashboard → Agents → check "Groups" or CLI:
/var/ossec/bin/agent_groups -l
Then verify:
/var/ossec/bin/agent_groups -a -i <agent_id> -g linux
If the agent is not in the group, it will never receive agent.conf.
2. After modifying agent.conf, agent need to pull updated configuration. You can restart agent, wait (default ~10 minutes) or force a restart with:
systemctl restart wazuh-agent
3. Wildcard handling, try explicitly:
<localfile>
<log_format>json</log_format>
<location>/tmp/packetbeat/*.ndjson</location>
</localfile>
Also confirm files actually exist with:
ls -l /tmp/packetbeat/
4. File permissions related with the agent, it runs as wazuh user, not root.
Check:
sudo -u wazuh cat /tmp/packetbeat/packetbeat-*.ndjson
If that fails there is a permission issue.
5. Confirm centralized config actually reached the agent, on the agent, check if agent.conf exists:
ls -l /var/ossec/etc/shared/linux/agent.conf
If not, manager didn't push it, you can find more details on /var/ossec/logs/ossec.log