/
fluent.conf
186 lines (163 loc) · 4.56 KB
/
fluent.conf
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# In v1 configuration, type and id are @ prefix parameters.
# @type and @id are recommended. type and id are still available for backward compatibility
# HTTP input
# http://localhost:8888/<tag>?json=<json>
<source>
@type http
@id http_input
@log_level debug
port 8888
</source>
## match fluent's internal events
#<match fluent.**>
# @type null
#</match>
#Add to all tag metrics the collectd plugin name
<match ovirt_collectd>
@type rewrite_tag_filter
rewriterule1 plugin ^(\w+\S+) plugin.${tag}.$1
</match>
#Statsd Plugin
<match plugin.ovirt_collectd.statsd>
@type rewrite_tag_filter
rewriterule1 type_instance ^(\w+\S+) statsd.${tag}.$1
</match>
<filter statsd.plugin.ovirt_collectd.statsd.vms.*.{nic,disk}.**>
@type record_transformer
enable_ruby
<record>
entity ${type_instance.split(".")[0]}
plugin_instance ${type_instance.split(".")[1]}
type ${type_instance.split(".")[2]}_${type_instance.split(".")[4]}
type_instance ${type_instance.split(".")[3]}
</record>
</filter>
<filter statsd.plugin.ovirt_collectd.statsd.vms.*.{balloon,cpu}.**>
@type record_transformer
enable_ruby
<record>
entity ${type_instance.split(".")[0]}
plugin_instance ${type_instance.split(".")[1]}
type ${type_instance.split(".")[2]}_${type_instance.split(".")[3]}
</record>
remove_keys type_instance
</filter>
<filter statsd.plugin.ovirt_collectd.statsd.hosts.memory.**>
@type record_transformer
enable_ruby
<record>
entity ${type_instance.split(".")[0]}
type ${type_instance.split(".")[1]}
type_instance ${type_instance.split(".")[2]}
</record>
</filter>
<filter statsd.plugin.ovirt_collectd.statsd.hosts.{cpu,swap,vms,storage,vdsm}.**>
@type record_transformer
enable_ruby
<record>
entity ${type_instance.split(".")[0]}
type ${type_instance.split(".")[1]}
type_instance ${type_instance.split(".")[2]}
</record>
</filter>
<filter statsd.plugin.ovirt_collectd.statsd.hosts.elapsed_time>
@type record_transformer
enable_ruby
<record>
entity ${type_instance.split(".")[0]}
type ${type_instance.split(".")[1]}
</record>
remove_keys type_instance
</filter>
<filter statsd.plugin.ovirt_collectd.statsd.hosts.{nic,disk}.**>
@type record_transformer
enable_ruby
<record>
entity ${type_instance.split(".")[0]}
type ${type_instance.split(".")[1]}_${type_instance.split(".")[3]}
type_instance ${type_instance.split(".")[2]}
</record>
</filter>
<filter statsd.plugin.ovirt_collectd.statsd.**>
@type record_transformer
enable_ruby
auto_typecast true
<record>
${record["plugin"]} {"${type}": {"${dsnames[0]}":"${values[0]}"}}
tag ${tag_parts[2]}
host_id {{ ovirt_vds_vds_id }}
hostname "#{Socket.gethostname}"
</record>
remove_keys host,values
</filter>
<filter plugin.ovirt_collectd.**>
@type record_transformer
enable_ruby
<record>
max_index ${values.length}
</record>
</filter>
<match plugin.ovirt_collectd.**>
@type rewrite_tag_filter
rewriterule1 max_index ^(1|2|3)$ idx.${tag}.$1
</match>
<filter idx.plugin.ovirt_collectd.*.1>
@type record_transformer
enable_ruby
auto_typecast true
<record>
${record["plugin"]} {"${type}": {"${dsnames[0]}":"${values[0]}"}}
</record>
</filter>
<filter idx.plugin.ovirt_collectd.*.2>
@type record_transformer
enable_ruby
auto_typecast true
<record>
${record["plugin"]} {"${type}":{"${dsnames[0]}":"${values[0]}","${dsnames[1]}":"${values[1]}"}}
</record>
</filter>
<filter idx.plugin.ovirt_collectd.*.3>
@type record_transformer
enable_ruby
auto_typecast true
<record>
${record["plugin"]} {"${type}":{"${dsnames[0]}":"${values[0]}","${dsnames[1]}":"${values[1]}","${dsnames[2]}":"${values[2]}"}}
</record>
</filter>
<filter idx.plugin.ovirt_collectd.virt**>
@type record_transformer
<record>
host_id {{ ovirt_vds_vds_id }}
tag ${tag_parts[2]}
hostname "#{Socket.gethostname}"
entity vms
</record>
remove_keys host,max_index,values
</filter>
<filter idx.plugin.ovirt_collectd.{cpu,load,interface,aggregation,swap,memory,nfs,df,entropy,disk,processes}.{1,2,3}>
@type record_transformer
enable_ruby
<record>
host_id {{ ovirt_vds_vds_id }}
tag ${tag_parts[2]}
hostname "#{Socket.gethostname}"
entity hosts
</record>
remove_keys host,max_index,values
</filter>
#match fluent's internal events
#<match fluent.**>
# @type stdout
#</match>
#Forward Plugin
<match **>
@type forward
heartbeat_type tcp
flush_interval 1s
<server>
name <metrics server name or IP>
host <metrics server name or IP>
port <metrics server port>
</server>
</match>