Filebeat using default input path instead of my log path

I have a filebeat installed in Ubuntu 20.04.
I have changed my input file path to my own log path.
But when it starts to service, it seems to collect the default system logs.
I tried to use

sudo /usr/share/filebeat/bin/filebeat -e -c /etc/filebeat/filebeat.yml

But it didn't work.
Here is my .yml file.

filebeat.inputs:
# filestream is an input for collecting log messages from files.
- type: filestream

    # Change to true to enable this input configuration.
    enabled: true

    # Paths that should be crawled and fetched. Glob based paths.
    paths:
        - /home/username/log_path/*.json
    json.keys_under_root: true
    json.overwrite_keys: true
    json.add_error_key: true

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.