检查Kibana中消息的正确顺序。

huangapple go评论59阅读模式
英文:

Check correct order of messages in Kibana

问题

在我的日志中,一些消息应该按照相同的顺序出现。但由于某种原因,在失败情况下,顺序被交换了。在Kibana中是否可以设置监控或仪表板来检测交换的消息?例如,当Alarm-Clear事件在Alarm-Set事件之前到达时。

在Set和Clear之间,通常不会超过两秒钟。因此,一种解决方案是在Set事件后等待两秒钟,以等待Clear事件。

更具体地说,有一些消息通过消息总线发送并由ELK接收。发送系统按正确的顺序发送消息,但在Kibana Discover中查看时,顺序被交换了。这是我想在Kibana中检测到的问题。

以下是发送系统的一些示例:

2023-05-03 07:40:09,535 [Queue.Package:28] INFO Send=<<AlarmID>135</AlarmID><AlarmText>AlarmSet</AlarmText>>
2023-05-03 07:40:09,535 [Queue.Package:28] INFO Send=<<AlarmID>135</AlarmID><AlarmText>AlarmClear</AlarmText>>

在ELK Discover中,AlarmClear在AlarmSet之前可见。

英文:

In my logs, some messages should appear in the same order. But for some reason, the order is swapped in failure case. Is it somehow possible in Kibana to set up monitoring or dashboard for swapped messages? E.g. when an Alarm-Clear event arrives before an Alarm-Set event.

Between Set and Clear, there are usually less than two seconds. So, a solution would also be to wait two seconds after the Set event for the Clear event.

More specific, there are messages send over a message bus and received by ELK. The sending system sends the messages in correct order but looking at Kibana Discover, the order is swapped. This I want to detect in Kibana.

Some example from the sending system:

2023-05-03 07:40:09,535 [Queue.Package:28] INFO Send=&lt;&lt;AlarmID&gt;135&lt;/AlarmID&gt;&lt;AlarmText&gt;AlarmSet&lt;/AlarmText&gt;&gt;
2023-05-03 07:40:09,535 [Queue.Package:28] INFO Send=&lt;&lt;AlarmID&gt;135&lt;/AlarmID&gt;&lt;AlarmText&gt;AlarmClear&lt;/AlarmText&gt;&gt;

In ELK Discover, AlarmClear before AlarmSet visible.

答案1

得分: 1

  1. 使用在将数据入队或索引到Elasticsearch之前的原始时间戳。对于Logstash,您可以使用date filter插件

  2. 使用transform根据AlarmID对数据进行聚合。Transform API将创建一个新的索引,您可以计算AlarmSet - AlarmClear之间的差异。

英文:

There are a couple of solutions for that. the first solution will help you to solve the problem. The second solution will help you to detect the problem.

1.solution

Use the original timestamp for the data before queueing and/or indexing data into elasticsearch. For logstash, you can use the date filter plugin.

2.solution

Use transform and aggregate the data according to AlarmID. Transform API will create a new index and you can calculate the diff between AlarmSet - AlarmClear.

huangapple
  • 本文由 发表于 2023年5月17日 19:53:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/76271799.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定