Adding upstream version 1.34.4.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
e393c3af3f
commit
4978089aab
4963 changed files with 677545 additions and 0 deletions
|
@ -0,0 +1,14 @@
|
|||
[agent]
|
||||
interval = "10s"
|
||||
|
||||
[[inputs.execd]]
|
||||
command = ["ruby", "plugins/inputs/execd/examples/count.rb"]
|
||||
|
||||
[[processors.execd]]
|
||||
command = ["ruby", "plugins/processors/execd/examples/multiplier_line_protocol/multiplier_line_protocol.rb"]
|
||||
|
||||
|
||||
[[outputs.file]]
|
||||
files = ["stdout"]
|
||||
data_format = "influx"
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
loop do
|
||||
# example input: "counter_ruby count=0 1586302128978187000"
|
||||
line = STDIN.readline.chomp
|
||||
# parse out influx line protocol sections with a really simple hand-rolled parser that doesn't support escaping.
|
||||
# for a full line parser in ruby, check out something like the influxdb-lineprotocol-parser gem.
|
||||
parts = line.split(" ")
|
||||
case parts.size
|
||||
when 3
|
||||
measurement, fields, timestamp = parts
|
||||
when 4
|
||||
measurement, tags, fields, timestamp = parts
|
||||
else
|
||||
STDERR.puts "Unable to parse line protocol"
|
||||
exit 1
|
||||
end
|
||||
fields = fields.split(",").map{|t|
|
||||
k,v = t.split("=")
|
||||
if k == "count"
|
||||
v = v.to_i * 2 # multiple count metric by two
|
||||
end
|
||||
"#{k}=#{v}"
|
||||
}.join(",")
|
||||
puts [measurement, tags, fields, timestamp].select{|s| s && s.size != 0 }.join(" ")
|
||||
STDOUT.flush
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue