-2

What is a good <source> format regex for this string?

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>
netsuvi
  • 1
  • 3
  • 1
    Possible duplicate of [Learning Regular Expressions](https://stackoverflow.com/questions/4736/learning-regular-expressions) – Biffen Feb 14 '18 at 12:59

1 Answers1

0

Here is the solution for fluentd

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