0

I am trying to run a script every time an error is found in logs

<Extension _exec>
    Module  xm_exec
</Extension>

<Input in>
    Module  im_file
    File    "/home/rafal/gitprojects/mst-sender/hub.cloudradar-error.log"
        <Exec>
        if $raw_event =~ /(\S+)\ (.+) \[ERROR (.+)/
        {
                exec_async("/bin/sh", "/home/rafal/gitprojects/mst-sender/run.sh");
        }

        </Exec>
</Input>

From their documentation it looks like it should exec async if regex matches but I am seeing only the following log WARNING not starting unused module in and the script is not executed. I don't need to output it, only run that script.

[UPDATE]added route

<Output out1>
    Module  om_null
</Output>

<Route 1>
    # Basic route
    Path    in => out1
</Route>
rafalf
  • 425
  • 7
  • 16

1 Answers1

2

I don't need to output it, only run that script.

You need to.
What you can do is to create a route with om_null so that the output is discarded.

b0ti
  • 2,319
  • 1
  • 18
  • 18