首页 新闻 会员 周边

请教个问题,filebeat不收集日志

0
悬赏园豆:5 [已解决问题] 解决于 2020-02-05 16:45

这个是配置文件

Filebeat Configuration Example

This file is an example configuration file highlighting only the most common

options. The filebeat.reference.yml file from the same directory contains all the

supported options with more comments. You can use it as a reference.

You can find the full configuration reference here:

https://www.elastic.co/guide/en/beats/filebeat/index.html

For more available modules and options, please see the filebeat.reference.yml sample

configuration file.

=========================== Filebeat inputs =============================

filebeat.inputs:

Each - is an input. Most options can be set at the input level, so

you can use different inputs for various configurations.

Below are the input specific configurations.

  • type: log

    Change to true to enable this input configuration.

    enabled: false

    Paths that should be crawled and fetched. Glob based paths.

    paths:
    • /var/log/*.log
      #- c:\programdata\elasticsearch\logs*

    Exclude lines. A list of regular expressions to match. It drops the lines that are

    matching any regular expression from the list.

    exclude_lines: ['^DBG']

    Include lines. A list of regular expressions to match. It exports the lines that are

    matching any regular expression from the list.

    include_lines: ['^ERR', '^WARN']

    Exclude files. A list of regular expressions to match. Filebeat drops the files that

    are matching any regular expression from the list. By default, no files are dropped.

    exclude_files: ['.gz$']

    Optional additional fields. These fields can be freely picked

    to add additional information to the crawled log files for filtering

    fields:

    level: debug

    review: 1

    Multiline options

    Multiline can be used for log messages spanning multiple lines. This is common

    for Java Stack Traces or C-Line Continuation

    The regexp Pattern that has to be matched. The example pattern matches all lines starting with [

    multiline.pattern: ^[

    Defines if the pattern set under pattern should be negated or not. Default is false.

    multiline.negate: false

    Match can be set to "after" or "before". It is used to define if lines should be append to a pattern

    that was (not) matched before or after or as long as a pattern is not matched based on negate.

    Note: After is the equivalent to previous and before is the equivalent to to next in Logstash

    multiline.match: after

============================= Filebeat modules ===============================

filebeat.config.modules:
# Glob pattern for configuration loading
path: ${path.config}/modules.d/*.yml

# Set to true to enable config reloading
reload.enabled: false

# Period on which files under path should be checked for changes
#reload.period: 10s

==================== Elasticsearch template setting ==========================

setup.template.settings:
index.number_of_shards: 3
#index.codec: best_compression
#_source.enabled: false

================================ General =====================================

The name of the shipper that publishes the network data. It can be used to group

all the transactions sent by a single shipper in the web interface.

name:

The tags of the shipper are included in their own field with each

transaction published.

tags: ["service-X", "web-tier"]

Optional fields that you can specify to add additional information to the

output.

fields:

env: staging

============================== Dashboards =====================================

These settings control loading the sample dashboards to the Kibana index. Loading

the dashboards is disabled by default and can be enabled either by setting the

options here, or by using the -setup CLI flag or the setup command.

setup.dashboards.enabled: false

The URL from where to download the dashboards archive. By default this URL

has a value which is computed based on the Beat name and version. For released

versions, this URL points to the dashboard archive on the artifacts.elastic.co

website.

setup.dashboards.url:

============================== Kibana =====================================

Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.

This requires a Kibana endpoint configuration.

setup.kibana:

# Kibana Host
# Scheme and port can be left out and will be set to the default (http and 5601)
# In case you specify and additional path, the scheme is required: http://localhost:5601/path
# IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
#host: "localhost:5601"

# Kibana Space ID
# ID of the Kibana Space into which the dashboards should be loaded. By default,
# the Default Space will be used.
#space.id:

============================= Elastic Cloud ==================================

These settings simplify using filebeat with the Elastic Cloud (https://cloud.elastic.co/).

The cloud.id setting overwrites the output.elasticsearch.hosts and

setup.kibana.host options.

You can find the cloud.id in the Elastic Cloud web UI.

cloud.id:

The cloud.auth setting overwrites the output.elasticsearch.username and

output.elasticsearch.password settings. The format is <user>:<pass>.

cloud.auth:

================================ Outputs =====================================

Configure what output to use when sending the data collected by the beat.

-------------------------- Elasticsearch output ------------------------------

output.elasticsearch:

# Array of hosts to connect to.

hosts: ["localhost:9200"]

# Enabled ilm (beta) to use index lifecycle management instead daily indices.
#ilm.enabled: false

# Optional protocol and basic auth credentials.
#protocol: "https"
#username: "elastic"
#password: "changeme"

----------------------------- Logstash output --------------------------------

output.logstash:
# The Logstash hosts
hosts: ["192.168.0.6:5044"]

# Optional SSL. By default is off.
# List of root certificates for HTTPS server verifications
#ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

# Certificate for SSL client authentication
#ssl.certificate: "/etc/pki/client/cert.pem"

# Client Certificate Key
#ssl.key: "/etc/pki/client/cert.key"

================================ Processors =====================================

Configure processors to enhance or manipulate events generated by the beat.

processors:

  • add_host_metadata: ~
  • add_cloud_metadata: ~

================================ 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: ["*"]

============================== Xpack Monitoring ===============================

filebeat can export internal metrics to a central Elasticsearch monitoring

cluster. This requires xpack monitoring to be enabled in Elasticsearch. The

reporting is disabled by default.

Set to true to enable the monitoring reporter.

xpack.monitoring.enabled: false

Uncomment to send the metrics to Elasticsearch. Most settings from the

Elasticsearch output are accepted here as well. Any setting that is not set is

automatically inherited from the Elasticsearch output configuration, so if you

have the Elasticsearch output configured, you can simply uncomment the

following line.

xpack.monitoring.elasticsearch:

这个是日志
2020-02-04T22:51:30.451-0500 INFO instance/beat.go:611 Home path: [/usr/local/elk/filebeat-6.8.6-linux-x86_64] Config path: [/usr/local/elk/filebeat-6.8.6-linux-x86_64] Data path: [/usr/local/elk/filebeat-6.8.6-linux-x86_64/data] Logs path: [/usr/local/elk/filebeat-6.8.6-linux-x86_64/logs]
2020-02-04T22:51:30.451-0500 INFO instance/beat.go:618 Beat UUID: 05bebefc-da2d-424f-adf7-801057c33454
2020-02-04T22:51:30.451-0500 INFO [seccomp] seccomp/seccomp.go:116 Syscall filter successfully installed
2020-02-04T22:51:30.452-0500 INFO [beat] instance/beat.go:931 Beat info {"system_info": {"beat": {"path": {"config": "/usr/local/elk/filebeat-6.8.6-linux-x86_64", "data": "/usr/local/elk/filebeat-6.8.6-linux-x86_64/data", "home": "/usr/local/elk/filebeat-6.8.6-linux-x86_64", "logs": "/usr/local/elk/filebeat-6.8.6-linux-x86_64/logs"}, "type": "filebeat", "uuid": "05bebefc-da2d-424f-adf7-801057c33454"}}}
2020-02-04T22:51:30.452-0500 INFO [beat] instance/beat.go:940 Build info {"system_info": {"build": {"commit": "4fa63eb23a94bf23650023317bdff335c4705fc2", "libbeat": "6.8.6", "time": "2019-12-13T16:15:17.000Z", "version": "6.8.6"}}}
2020-02-04T22:51:30.452-0500 INFO [beat] instance/beat.go:943 Go runtime info {"system_info": {"go": {"os":"linux","arch":"amd64","max_procs":4,"version":"go1.10.8"}}}
2020-02-04T22:51:30.453-0500 INFO [beat] instance/beat.go:947 Host info {"system_info": {"host": {"architecture":"x86_64","boot_time":"2020-02-04T22:07:52-05:00","containerized":false,"name":"localhost.localdomain","ip":["127.0.0.1/8","::1/128","192.168.0.6/24","fe80::923b:e421:5b93:e6d7/64"],"kernel_version":"3.10.0-1062.el7.x86_64","mac":["00:0c:29:b0:e7:c4","00:0c:29:b0:e7:ce"],"os":{"family":"redhat","platform":"centos","name":"CentOS Linux","version":"7 (Core)","major":7,"minor":7,"patch":1908,"codename":"Core"},"timezone":"EST","timezone_offset_sec":-18000,"id":"f311bc113c004dafbdc84930c66e7be0"}}}
2020-02-04T22:51:30.454-0500 INFO [beat] instance/beat.go:976 Process info {"system_info": {"process": {"capabilities": {"inheritable":null,"permitted":["chown","dac_override","dac_read_search","fowner","fsetid","kill","setgid","setuid","setpcap","linux_immutable","net_bind_service","net_broadcast","net_admin","net_raw","ipc_lock","ipc_owner","sys_module","sys_rawio","sys_chroot","sys_ptrace","sys_pacct","sys_admin","sys_boot","sys_nice","sys_resource","sys_time","sys_tty_config","mknod","lease","audit_write","audit_control","setfcap","mac_override","mac_admin","syslog","wake_alarm","block_suspend"],"effective":["chown","dac_override","dac_read_search","fowner","fsetid","kill","setgid","setuid","setpcap","linux_immutable","net_bind_service","net_broadcast","net_admin","net_raw","ipc_lock","ipc_owner","sys_module","sys_rawio","sys_chroot","sys_ptrace","sys_pacct","sys_admin","sys_boot","sys_nice","sys_resource","sys_time","sys_tty_config","mknod","lease","audit_write","audit_control","setfcap","mac_override","mac_admin","syslog","wake_alarm","block_suspend"],"bounding":["chown","dac_override","dac_read_search","fowner","fsetid","kill","setgid","setuid","setpcap","linux_immutable","net_bind_service","net_broadcast","net_admin","net_raw","ipc_lock","ipc_owner","sys_module","sys_rawio","sys_chroot","sys_ptrace","sys_pacct","sys_admin","sys_boot","sys_nice","sys_resource","sys_time","sys_tty_config","mknod","lease","audit_write","audit_control","setfcap","mac_override","mac_admin","syslog","wake_alarm","block_suspend"],"ambient":null}, "cwd": "/home/centos/shell", "exe": "/usr/local/elk/filebeat-6.8.6-linux-x86_64/filebeat", "name": "filebeat", "pid": 1918, "ppid": 1917, "seccomp": {"mode":"filter","no_new_privs":true}, "start_time": "2020-02-04T22:51:30.080-0500"}}}
2020-02-04T22:51:30.454-0500 INFO instance/beat.go:280 Setup Beat: filebeat; Version: 6.8.6
2020-02-04T22:51:33.458-0500 INFO add_cloud_metadata/add_cloud_metadata.go:340 add_cloud_metadata: hosting provider type not detected.
2020-02-04T22:51:33.461-0500 DEBUG [publish] pipeline/consumer.go:137 start pipeline event consumer
2020-02-04T22:51:33.461-0500 INFO [publisher] pipeline/module.go:110 Beat name: localhost.localdomain
2020-02-04T22:51:33.465-0500 INFO [monitoring] log/log.go:117 Starting metrics logging every 30s
2020-02-04T22:51:33.465-0500 INFO instance/beat.go:402 filebeat start running.
2020-02-04T22:51:33.465-0500 INFO registrar/registrar.go:134 Loading registrar data from /usr/local/elk/filebeat-6.8.6-linux-x86_64/data/registry
2020-02-04T22:51:33.466-0500 INFO registrar/registrar.go:141 States Loaded from registrar: 0
2020-02-04T22:51:33.466-0500 WARN beater/filebeat.go:367 Filebeat is unable to load the Ingest Node pipelines for the configured modules because the Elasticsearch output is not configured/enabled. If you have already loaded the Ingest Node pipelines or are using Logstash pipelines, you can ignore this warning.
2020-02-04T22:51:33.466-0500 INFO crawler/crawler.go:72 Loading Inputs: 1
2020-02-04T22:51:33.466-0500 INFO crawler/crawler.go:106 Loading and starting Inputs completed. Enabled inputs: 0
2020-02-04T22:51:33.466-0500 INFO cfgfile/reload.go:150 Config reloader started
2020-02-04T22:51:33.467-0500 INFO cfgfile/reload.go:205 Loading of config files completed.
2020-02-04T22:52:03.472-0500 INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":70,"time":{"ms":75}},"total":{"ticks":90,"time":{"ms":97},"value":90},"user":{"ticks":20,"time":{"ms":22}}},"handles":{"limit":{"hard":65535,"soft":65535},"open":5},"info":{"ephemeral_id":"b0f46c2d-cfc2-4646-b404-fbf9ad9c36b6","uptime":{"ms":33029}},"memstats":{"gc_next":4194304,"memory_alloc":2021200,"memory_total":4978312,"rss":17391616}},"filebeat":{"harvester":{"open_files":0,"running":0}},"libbeat":{"config":{"module":{"running":0},"reloads":1},"output":{"type":"logstash"},"pipeline":{"clients":0,"events":{"active":0}}},"registrar":{"states":{"current":0}},"system":{"cpu":{"cores":4},"load":{"1":0.01,"15":0.05,"5":0.02,"norm":{"1":0.0025,"15":0.0125,"5":0.005}}}}}}
2020-02-04T22:52:33.474-0500 INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":80,"time":{"ms":13}},"total":{"ticks":100,"time":{"ms":13},"value":100},"user":{"ticks":20}},"handles":{"limit":{"hard":65535,"soft":65535},"open":5},"info":{"ephemeral_id":"b0f46c2d-cfc2-4646-b404-fbf9ad9c36b6","uptime":{"ms":63036}},"memstats":{"gc_next":4194304,"memory_alloc":2308136,"memory_total":5265248}},"filebeat":{"harvester":{"open_files":0,"running":0}},"libbeat":{"config":{"module":{"running":0}},"pipeline":{"clients":0,"events":{"active":0}}},"registrar":{"states":{"current":0}},"system":{"load":{"1":0.01,"15":0.05,"5":0.02,"norm":{"1":0.0025,"15":0.0125,"5":0.005}}}}}}
2020-02-04T22:53:03.474-0500 INFO [monitoring] log/log.go:144 Non-zero metrics in the last 30s {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":90,"time":{"ms":11}},"total":{"ticks":110,"time":{"ms":15},"value":110},"user":{"ticks":20,"time":{"ms":4}}},"handles":{"limit":{"hard":65535,"soft":65535},"open":5},"info":{"ephemeral_id":"b0f46c2d-cfc2-4646-b404-fbf9ad9c36b6","uptime":{"ms":93029}},"memstats":{"gc_next":4194304,"memory_alloc":2572664,"memory_total":5529776}},"filebeat":{"harvester":{"open_files":0,"running":0}},"libbeat":{"config":{"module":{"running":0}},"pipeline":{"clients":0,"events":{"active":0}}},"registrar":{"states":{"current":0}},"system":{"load":{"1":0,"15":0.05,"5":0.01,"norm":{"1":0,"15":0.0125,"5":0.0025}}}}}}

Free-Wiki的主页 Free-Wiki | 菜鸟二级 | 园豆:205
提问于:2020-02-05 11:55
< >
分享
最佳答案
0

filebeat.inputs:
 type: log
 enabled: false
 paths:
  /var/log/*.log
--------------------------
enabled没有换成true

收获园豆:5
hatsuhi | 初学一级 |园豆:149 | 2020-02-05 13:12
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册