"list" key => "vortex" thread-6ren">
gpt4 book ai didi

redis - influxdb 中只有字符串

转载 作者:可可西里 更新时间:2023-11-01 11:17:50 26 4
gpt4 key购买 nike

我在 logstash 中有这个配置文件

input {


redis{
host => "localhost"
data_type => "list"
key => "vortex"
threads => 4
type => "testrecord"
codec => "plain"

}
}

filter {
kv {
add_field => {
"test1" => "yellow"
"test" => "ife"
"feild" => "pink"
}
}
}

output {

stdout { codec => rubydebug }

influxdb {
db => "toast"
host => "localhost"
measurement => "myseries"
allow_time_override => true
use_event_fields_for_data_points => true
exclude_fields => ["@version", "@timestamp", "sequence", "message", "type", "host"]
send_as_tags => ["bar", "feild", "test1", "test"]

}
}


以及包含以下数据的 redis 列表:

foo=10207 bar=1 sensor2=1 sensor3=33.3 time=1489686662

一切正常,但无论值如何,influx 中的每个字段都被定义为字符串。

有人知道如何解决这个问题吗?

最佳答案

The mutate filter可能是您在这里寻找的东西。

filter {
mutate {
convert => {
"value" => "integer"
"average" => "float"
}
}
}

这意味着您需要事先知道您的字段是什么,但它会将它们转换为正确的数据类型。

关于redis - influxdb 中只有字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42841463/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com