正在显示
2 个修改的文件
包含
87 行增加
和
64 行删除
@@ -9,72 +9,53 @@ go-stash有大概logstash 5倍的吞吐性能,并且部署简单,一个可 | @@ -9,72 +9,53 @@ go-stash有大概logstash 5倍的吞吐性能,并且部署简单,一个可 | ||
9 | ## Quick Start | 9 | ## Quick Start |
10 | 10 | ||
11 | ```shell | 11 | ```shell |
12 | -gostash -f etc/config.json | 12 | +gostash -f etc/config.yaml |
13 | ``` | 13 | ``` |
14 | 14 | ||
15 | -config.json示例如下: | ||
16 | - | ||
17 | -```json | ||
18 | -{ | ||
19 | - "Input": { | ||
20 | - "Kafka": { | ||
21 | - "Name": "gostash", | ||
22 | - "Brokers": [ | ||
23 | - "172.16.186.16:19092", | ||
24 | - "172.16.186.17:19092" | ||
25 | - ], | ||
26 | - "Topic": "k8slog", | ||
27 | - "Group": "pro", | ||
28 | - "NumProducers": 16 | ||
29 | - } | ||
30 | - }, | ||
31 | - "Filters": [ | ||
32 | - { | ||
33 | - "Action": "drop", | ||
34 | - "Conditions": [ | ||
35 | - { | ||
36 | - "Key": "k8s_container_name", | ||
37 | - "Value": "-rpc", | ||
38 | - "Type": "contains" | ||
39 | - }, | ||
40 | - { | ||
41 | - "Key": "level", | ||
42 | - "Value": "info", | ||
43 | - "Type": "match", | ||
44 | - "Op": "and" | ||
45 | - } | ||
46 | - ] | ||
47 | - }, | ||
48 | - { | ||
49 | - "Action": "remove_field", | ||
50 | - "Fields": [ | ||
51 | - "message", | ||
52 | - "_source", | ||
53 | - "_type", | ||
54 | - "_score", | ||
55 | - "_id", | ||
56 | - "@version", | ||
57 | - "topic", | ||
58 | - "index", | ||
59 | - "beat", | ||
60 | - "docker_container", | ||
61 | - "offset", | ||
62 | - "prospector", | ||
63 | - "source", | ||
64 | - "stream" | ||
65 | - ] | ||
66 | - } | ||
67 | - ], | ||
68 | - "Output": { | ||
69 | - "ElasticSearch": { | ||
70 | - "Hosts": [ | ||
71 | - "172.16.141.4:9200", | ||
72 | - "172.16.141.5:9200" | ||
73 | - ], | ||
74 | - "DailyIndexPrefix": "k8s_pro-" | ||
75 | - } | ||
76 | - } | ||
77 | -} | 15 | +config.yaml示例如下: |
16 | + | ||
17 | +```yaml | ||
18 | +Input: | ||
19 | + Kafka: | ||
20 | + Name: gostash | ||
21 | + Brokers: | ||
22 | + - 172.16.186.16:19092 | ||
23 | + - 172.16.186.17:19092 | ||
24 | + Topic: k8slog | ||
25 | + Group: pro | ||
26 | + NumProducers: 16 | ||
27 | +Filters: | ||
28 | + - Action: drop | ||
29 | + Conditions: | ||
30 | + - Key: k8s_container_name | ||
31 | + Value: "-rpc" | ||
32 | + Type: contains | ||
33 | + - Key: level | ||
34 | + Value: info | ||
35 | + Type: match | ||
36 | + Op: and | ||
37 | + - Action: remove_field | ||
38 | + Fields: | ||
39 | + - message | ||
40 | + - _source | ||
41 | + - _type | ||
42 | + - _score | ||
43 | + - _id | ||
44 | + - "@version" | ||
45 | + - topic | ||
46 | + - index | ||
47 | + - beat | ||
48 | + - docker_container | ||
49 | + - offset | ||
50 | + - prospector | ||
51 | + - source | ||
52 | + - stream | ||
53 | +Output: | ||
54 | + ElasticSearch: | ||
55 | + Hosts: | ||
56 | + - 172.16.141.4:9200 | ||
57 | + - 172.16.141.5:9200 | ||
58 | + DailyIndexPrefix: k8s_pro- | ||
78 | ``` | 59 | ``` |
79 | 60 | ||
80 | ### 微信交流群 | 61 | ### 微信交流群 |
stash/etc/config.yaml
0 → 100644
1 | +--- | ||
2 | +Input: | ||
3 | + Kafka: | ||
4 | + Name: gostash | ||
5 | + Brokers: | ||
6 | + - 172.16.186.16:19092 | ||
7 | + - 172.16.186.17:19092 | ||
8 | + Topic: k8slog | ||
9 | + Group: pro | ||
10 | + NumProducers: 16 | ||
11 | +Filters: | ||
12 | + - Action: drop | ||
13 | + Conditions: | ||
14 | + - Key: k8s_container_name | ||
15 | + Value: "-rpc" | ||
16 | + Type: contains | ||
17 | + - Key: level | ||
18 | + Value: info | ||
19 | + Type: match | ||
20 | + Op: and | ||
21 | + - Action: remove_field | ||
22 | + Fields: | ||
23 | + - message | ||
24 | + - _source | ||
25 | + - _type | ||
26 | + - _score | ||
27 | + - _id | ||
28 | + - "@version" | ||
29 | + - topic | ||
30 | + - index | ||
31 | + - beat | ||
32 | + - docker_container | ||
33 | + - offset | ||
34 | + - prospector | ||
35 | + - source | ||
36 | + - stream | ||
37 | +Output: | ||
38 | + ElasticSearch: | ||
39 | + Hosts: | ||
40 | + - 172.16.141.4:9200 | ||
41 | + - 172.16.141.5:9200 | ||
42 | + DailyIndexPrefix: k8s_pro- |
-
请 注册 或 登录 后发表评论