Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Logging Filebeat:监视目录层次结构的两个级别 我的问题_Logging_Filebeat - Fatal编程技术网

Logging Filebeat:监视目录层次结构的两个级别 我的问题

Logging Filebeat:监视目录层次结构的两个级别 我的问题,logging,filebeat,Logging,Filebeat,考虑以下目录结构: /var/log/quodo/campaigns/deployment_29/campaign-32/users.log /var/log/quodo/campaigns/deployment_29/campaign-12/ads.log /var/log/quodo/campaigns/deployment_55/campaign-77/users.log /var/log/quodo/campaigns/deployment_55/campaign-37/ads.log

考虑以下目录结构:

/var/log/quodo/campaigns/deployment_29/campaign-32/users.log
/var/log/quodo/campaigns/deployment_29/campaign-12/ads.log
/var/log/quodo/campaigns/deployment_55/campaign-77/users.log
/var/log/quodo/campaigns/deployment_55/campaign-37/ads.log
...
我想使用Filebeat将/var/log/quodo/campaigns//下的所有日志记录到ElasticSearch

档案节拍:

要从预定义的子目录级别获取所有文件,可以使用以下模式:/var/log/*/*.log

这将从/var/log的子文件夹中获取所有.log文件。它不会从/var/log文件夹本身获取日志文件。目前,不可能递归地获取目录所有子目录中的所有文件

我试过什么 我的问题
我可以在Filebeat配置的目录层次结构中使用两级*吗?

下面是我的Filebeat版本

$ filebeat.sh --version
filebeat version 5.6.2 (amd64), libbeat 5.6.2
我试着在下面配置

filebeat.prospectors:

- input_type: log

  paths:
    - /var/log/**/**/*


output.console:
  pretty: true

logging.level: debug
这对我来说非常有效

{
  "@timestamp": "2017-10-07T18:12:17.694Z",
  "beat": {
    "hostname": "vagrant",
    "name": "vagrant",
    "version": "5.6.2"
  },
  "input_type": "log",
  "message": "tarun",
  "offset": 6,
  "source": "/var/log/test1/test3/test.log",
  "type": "log"
}

下面是我的filebeat版本

$ filebeat.sh --version
filebeat version 5.6.2 (amd64), libbeat 5.6.2
我试着在下面配置

filebeat.prospectors:

- input_type: log

  paths:
    - /var/log/**/**/*


output.console:
  pretty: true

logging.level: debug
这对我来说非常有效

{
  "@timestamp": "2017-10-07T18:12:17.694Z",
  "beat": {
    "hostname": "vagrant",
    "name": "vagrant",
    "version": "5.6.2"
  },
  "input_type": "log",
  "message": "tarun",
  "offset": 6,
  "source": "/var/log/test1/test3/test.log",
  "type": "log"
}

我在filebeat版本7.6.1上使用它来监视递归

filebeat.prospectors:
  - input_type: log
  paths:
    - /var/log/**/*

我在filebeat版本7.6.1上使用它来监视递归

filebeat.prospectors:
  - input_type: log
  paths:
    - /var/log/**/*

整洁的将尽快进行试驾。谢谢!整洁的将尽快进行试驾。谢谢!