Crates.io | syslogio |
lib.rs | syslogio |
version | 0.2.1 |
source | src |
created_at | 2022-04-22 16:07:42.848052 |
updated_at | 2022-05-10 13:58:56.439352 |
description | Command line utilities to work with UNIX syslog |
homepage | https://sr.ht/~jpastuszek/syslogio/ |
repository | https://git.sr.ht/~jpastuszek/syslogio |
max_upload_size | |
id | 572291 |
size | 49,722 |
Command line utilities to work with UNIX syslog.
Read syslog messages from a UNIX domain datagram socket and format it to standard output.
Features:
#012
(configurable) to preserve message boundaries when using syslog
output format.syslog
output format.-T
flag).Read messages from syslog socket and print them in human readable form:
umask 0000
syslog-unix /dev/log human
Prints messages like this:
user.notice: 2022-04-22 15:10:26.566281 someuser: hello world
Read messages from syslog socket and print them in syslog format suitable for forwarding to syslog server:
umask 0000
syslog-unix /dev/log syslog
Prints messages like this:
<13>Apr 22 15:58:03 somehost someuser: hello world
Read log message from standard input and format it as syslog message to a UNIX domain socket.
Log a single message:
syslog-logger $USER "hello world"
Log every line of standard input as a separate message:
ls | syslog-logger ls
Log standard input as a single message:
fortune | syslog-logger -1 fortune
Read log message from standard input and format it as syslog message to a UNIX domain socket, while reconstructing log messages spanning multiple lines as one message.
syslog-mlogger java-app '^\s+' --negate --strip-pattern <<EOF
Exception in thread "main" java.lang.NullPointerException
at com.example.myproject.Book.getTitle(Book.java:16)
at com.example.myproject.Author.getBookTitles(Author.java:25)
at com.example.myproject.Bootstrap.main(Bootstrap.java:14)
Exception in thread "main" java.lang.NullPointerException
at com.example.myproject.Book.getTitle(Book.java:16)
at com.example.myproject.Author.getBookTitles(Author.java:25)
at com.example.myproject.Bootstrap.main(Bootstrap.java:14)
Hello world!
Exception in thread "main" java.lang.NullPointerException
at com.example.myproject.Book.getTitle(Book.java:16)
at com.example.myproject.Author.getBookTitles(Author.java:25)
at com.example.myproject.Bootstrap.main(Bootstrap.java:14)
EOF
The example command will log 4 syslog messages:
<13>Apr 22 15:02:30 java-app: Exception in thread "main" java.lang.NullPointerException
at com.example.myproject.Book.getTitle(Book.java:16)
at com.example.myproject.Author.getBookTitles(Author.java:25)
at com.example.myproject.Bootstrap.main(Bootstrap.java:14)
<13>Apr 22 15:02:30 java-app: Exception in thread "main" java.lang.NullPointerException
at com.example.myproject.Book.getTitle(Book.java:16)
at com.example.myproject.Author.getBookTitles(Author.java:25)
at com.example.myproject.Bootstrap.main(Bootstrap.java:14)
<13>Apr 22 15:02:30 java-app: Hello world!
<13>Apr 22 15:02:30 java-app: Exception in thread "main" java.lang.NullPointerException
at com.example.myproject.Book.getTitle(Book.java:16)
at com.example.myproject.Author.getBookTitles(Author.java:25)
at com.example.myproject.Bootstrap.main(Bootstrap.java:14)
Install cargo
utility with your package manager.
After installation with cargo
utility the binaries will be located in ~/.cargo/bin
.
cargo install syslogio
Clone the source code repository with Git.
In the source directory run:
cargo install --path . --force