小编Jas*_*gan的帖子

Logstash 配置:如果 ["list item 1"] 中的 [field] 有条件,则列表不起作用

我正在使用 Logstash 处理一些流数据。现在我在使用条件标记数据时遇到了一个问题。

如果我在logstash配置中写下以下内容

if [myfield] == "abc"{ mutate { add_tag => ["mytag"] } }
else { mutate { add_tag => ["not_working"] } }
Run Code Online (Sandbox Code Playgroud)

一切正常,但现在我想使用一个列表

if [myfield] is in ["abc"]{ mutate { add_tag => ["mytag"] } }
else { mutate { add_tag => ["not_working"] } }
Run Code Online (Sandbox Code Playgroud)

并且只得到一个 not_working 标签。

有什么建议?提前致谢!

logstash logstash-configuration

4
推荐指数
1
解决办法
7283
查看次数

使用gnuplot从时间序列图中的文件中的数据绘制垂直线

我目前正在研究一个项目,以绘制我所在地的湿度和温度的发展.因此,我使用Raspbian Jessie和DHT-22的树莓派2.

最后它归结为每天一个文件,它将测量值存储在30秒内.该文件的名称如下; 2016-01-30_Temp_Hum_data并包含以下数据

2016-01-30-19:30:03 22.0 50.2
2016-01-30-19:30:34 22.0 50.2
2016-01-30-19:31:04 22.0 50.3
2016-01-30-19:31:35 22.0 50.3
2016-01-30-19:32:05 22.0 50.2
Run Code Online (Sandbox Code Playgroud)

而第一部分是时间戳,第二部分用空格分隔的是温度,接着是湿度.

现在我用以下脚本绘制它,该脚本由bash文件中的for循环调用,该文件迭代我上面描述的所有数据文件.

!/usr/bin/gnuplot
reset

# This command works for a linux computer. In linux, you need to specify the exact location of
# the font you want to use
set terminal png notransparent rounded giant font "/usr/share/fonts/msttcore/arial.ttf" 24 \
  size 2600,960

# nomirror means do not put tics on the opposite side of the plot
set xtics nomirror
set ytics nomirror …
Run Code Online (Sandbox Code Playgroud)

bash gnuplot

3
推荐指数
1
解决办法
1803
查看次数

标签 统计

bash ×1

gnuplot ×1

logstash ×1

logstash-configuration ×1