Change log output of Filebeat

My logs path is: /var/log/filebeat

How can i change it to /opt/filebeat/log/filebeat.log ?

I cant see any options for changing this in my filebeat.yml file. I only have this:

#================================ Logging =====================================

# Sets log level. The default log level is info.
# Available log levels are: error, warning, info, debug
#logging.level: debug

# At debug level, you can selectively enable logging only for some components.
# To enable all selectors use ["*"]. Examples of other selectors are "beat",
# "publish", "service".
#logging.selectors: ["*"]

Tried to look at https://www.elastic.co/guide/en/beats/filebeat/current/configuration-logging.html but it didnt help me.

Hi,

Please find below configuration to change the paths. this is the generic you can try according to your requirement.

#================================= Paths ======================================

# The home path for the filebeat installation. This is the default base path
# for all other path settings and for miscellaneous files that come with the
# distribution (for example, the sample dashboards).
# If not set by a CLI flag or in the configuration file, the default for the
# home path is the location of the binary.
#path.home:

# The configuration path for the filebeat installation. This is the default
# base path for configuration files, including the main YAML configuration file
# and the Elasticsearch template file. If not set by a CLI flag or in the
# configuration file, the default for the configuration path is the home path.
#path.config: ${path.home}

# The data path for the filebeat installation. This is the default base path
# for all the files in which filebeat needs to store its data. If not set by a
# CLI flag or in the configuration file, the default for the data path is a data
# subdirectory inside the home path.
#path.data: ${path.home}/data

# The logs path for a filebeat installation. This is the default location for
# the Beat's log files. If not set by a CLI flag or in the configuration file,
# the default for the logs path is a logs subdirectory inside the home path.
#path.logs: ${path.home}/logs

Regards,
Harsh

Ive added the following to my filebeat.yml:

#================================= Paths ======================================

# The home path for the filebeat installation. This is the default base path
# for all other path settings and for miscellaneous files that come with the
# distribution (for example, the sample dashboards).
# If not set by a CLI flag or in the configuration file, the default for the
# home path is the location of the binary.
#path.home:

# The configuration path for the filebeat installation. This is the default
# base path for configuration files, including the main YAML configuration file
# and the Elasticsearch template file. If not set by a CLI flag or in the
# configuration file, the default for the configuration path is the home path.
#path.config: ${path.home}

# The data path for the filebeat installation. This is the default base path
# for all the files in which filebeat needs to store its data. If not set by a
# CLI flag or in the configuration file, the default for the data path is a data
# subdirectory inside the home path.
#path.data: ${path.home}/data

# The logs path for a filebeat installation. This is the default location for
# the Beat's log files. If not set by a CLI flag or in the configuration file,
# the default for the logs path is a logs subdirectory inside the home path.
path.logs: /opt/filebeat/logs

Then I get the same log path:

sudo service filebeat restart
2018-07-02T13:45:00.966+0200 INFO instance/beat.go:468 Home path: [/usr/share/filebeat] Config path: [/etc/filebeat] Data path: [/var/lib/filebeat] Logs path: [/var/log/filebeat]
2018-07-02T13:45:00.967+0200 INFO instance/beat.go:475 Beat UUID: 1f9e07f3-e887-4ad5-9e6e-1ca6f371dfcd
2018-07-02T13:45:00.967+0200 INFO instance/beat.go:213 Setup Beat: filebeat; Version: 6.2.4
2018-07-02T13:45:00.968+0200 INFO pipeline/module.go:76 Beat name: xxxxxx

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