I am trying to use (Ubuntu) logger command to send data to Logstash. I want the data to contain JSON structured data, like:

logger -p syslog.warn "{"user":"admin", "password":"admin"}}"

I remember once I read something about @eee somewhere but I can't found that page again, kind of:

logger -p syslog.warn @eee"{"user":"admin", "password":"admin"}}

How can I send JSON data with logger command?


I'm not sure about the eee stuff, but you just need to change your command a little bit (escaping the quotation marks):

logger -p syslog.warn {\"user\":\"admin\", \"password\":\"admin\"}

Meanwhile, run tailf to watch the syslog

$ tailf /var/log/syslog
Jan 12 18:25:48 laptop ubuntu: {"user":"admin", "password":"admin"}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.