user12569851
user12569851

Reputation:

How to monitor JournalD for Error/Fatal error messages of some particular process and start some callback if any

How to monitor JournalD for Error/Fatal error messages of some particular process and start some callback if any. Say if some service - say Nginx posts a log with Error - some script would call. How to make such a script?

Upvotes: 1

Views: 488

Answers (1)

user12524810
user12524810

Reputation:

You have to use journalctl --unit darts-game-server.service --follow -o json stream and parse the output in your code. There are libs for that as well.

Upvotes: 0

Related Questions