Some configuration can be rather difficult to debug, so LogHub provides a CLI usae that can be used to debug a configuration.
The syntax for this command is:
test Usage: test [options] files* Options: --pipeline, -p Pipeline to test
The first step is to collect events event by logging them.
This can be done by using the following step.
pipeline[totest]{ log("\n${%j}", INFO) | ... }
The logging level for the pipeline, loghub.pipeline.totest in this example should be at adapted level, INFO in this case.
loghub.pipeline.totest
INFO
One will then get a logline for each event:
[2025-06-17 17:31:39,950] FATAL loghub.pipeline.totest : {"loghub.Event":{"@timestamp":"2025-06-17T15:31:35.568Z","@fields":{"a":1,"b":"2"},"@METAS":{"c":"3"}}}
The wanted event are to be collected in a file that contains events. To see how they will be process, it’s as simple as:
java -jar .../loghub.jar -c .../loghub.conf test -p totest events.json
Then each event on be displayed and pretty printed on stdout.
Pipeline forwarding will not be applied, but subpipeline will be executed.
For example, with the following configuration.
pipeline[pipe1]{ $pipe2 } | $pipe3 pipeline[pipe2]{ [a] = 1 } pipeline[pipe3]{ [b] = 2 }
After testing pipe1, pipe2 would have been executed but not pipe3, so [a] == 1 will be true, but not [b] == 2.
pipe1
pipe2
pipe3
[a] == 1
[b] == 2
There was an error while loading. Please reload this page.