filebeat.yml 的配置
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94#====================== input ================= filebeat.inputs: - type: log enabled: true paths: - /home/www/test/logs/*/*/info.log tags: ["codeflag-info-log"] fields: index: 'codeflag-test-info' - type: log enabled: true paths: - /home/www/test/logs/*/*/error.log json.keys_under_root: true tags: ["codeflag-error_log"] fields: index: 'codeflag-test-error' - type: log enabled: true paths: - /home/www/test/logs/*/*/service.log json.keys_under_root: true tags: ["codeflag-service_log"] fields: index: 'codeflag-test-service' - type: log enabled: true paths: - /home/www/prod/logs/api/*/info.log tags: ["codeflag-info-log"] fields: index: 'codeflag-prod-info' - type: log enabled: true paths: - /home/www/prod/logs/api/*/error.log json.keys_under_root: true tags: ["codeflag-error_log"] fields: index: 'codeflag-prod-error' - type: log enabled: true paths: - /home/www/prod/logs/api/*/service.log json.keys_under_root: true tags: ["codeflag-service_log"] fields: index: 'codeflag-prod-service' #================ output ===================== output.elasticsearch: hosts: ["172.18.0.219:9200"] indices: - index: "codeflag-test-info" when.contains: fields: index: 'codeflag-test-info' - index: "codeflag-test-error" when.contains: fields: index: 'codeflag-test-error' - index: "codeflag-test-service" when.contains: fields: index: 'codeflag-test-service' - index: "codeflag-prod-info" when.contains: fields: index: 'codeflag-prod-info' - index: "codeflag-prod-error" when.contains: fields: index: 'codeflag-prod-error' - index: "codeflag-prod-service" when.contains: fields: index: 'codeflag-prod-service' #============== Elasticsearch template setting ========== setup.template.name: "codeflag" setup.template.pattern: "codeflag-*" #setup.template.overwrite: false setup.template.enabled: true setup.kibana: host: "172.18.0.219:80" #================== processors config =================== processors: - drop_fields: fields: ["input_type", "offset", "beat.name","beat.version","beat.hostname","input.type","prospector.type","log.file.path"]
相关参考:
加载Elasticsearch索引模板
https://www.cnblogs.com/qinwengang/p/10980871.html
官方文档
https://www.elastic.co/guide/en/beats/filebeat/current/filtering-and-enhancing-data.html
最后
以上就是传统铅笔最近收集整理的关于filebeat 监控多个文件,并且写入不同 index的 elasticsearch中的全部内容,更多相关filebeat内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复