0

I want to filter some logs from clients and push them to kafka, however, it didn't work, log config file:

module(load="omkafka")
module(load="imtcp" streamdriver.mode="1" streamdriver.authmode="anon")
input(type="imtcp" port="10514")
if $msg contains 'topic-*' then action(type="omkafka" topic="topic" broker=["10.3.1.9:9092", "10.3.1.8:9092", "10.3.1.7:9092", "10.3.1.6:9092"])

when I remove the if...then... clause, it works.

sayume
  • 128
  • 1
  • 8
  • Are you trying to match messages starting with 'topic-'? or actually those containing the string 'topic-*'? If it's the latter, you can try if $msg startswith 'topic-' – Radu Gheorghe Nov 09 '15 at 12:24
  • I misunderstood the meaning of $msg, it should be $programname. – sayume Nov 10 '15 at 05:37

0 Answers0