【问题标题】:fluentd regex for string with timestamp and message带有时间戳和消息的字符串的流利正则表达式
【发布时间】:2018-02-14 12:58:26
【问题描述】:

对于这个字符串,什么是好的 格式正则表达式?

05.02.2018 15:24:21.999|type|Element1|Element2|message
<source>
  format RegEX?
  path /home/filepath/*.log
  pos_file /var/cache/fluentd/file.pos
  tag mytag
  @type tail
</source>

【问题讨论】:

标签: regex timestamp fluentd


【解决方案1】:

这里是fluentd的解决方案

format /^(?<time>[^ ]* [^ ]*)\|(?<type>.*)\|(?<Component1>.*)\|(?<SubComponent2>.*)\|(?<message>.*)/ 
time_format %d.%m.%Y %H:%M:%S 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多