From: Karel Zak <kzak@redhat.com>
To: Priya Ahuja <priahuja321@gmail.com>
Cc: util-linux@vger.kernel.org, Ruediger Meier <ruediger.meier@ga-group.nl>
Subject: Re: Custom structured data from logger utility
Date: Thu, 1 Oct 2015 14:58:40 +0200 [thread overview]
Message-ID: <20151001125840.GF1787@ws.net.home> (raw)
In-Reply-To: <CAGQyBevyqMbq6KuRi5=E_QnXmjE4BK7P=sK4awostLf5uNiYuA@mail.gmail.com>
On Fri, Sep 18, 2015 at 04:25:29PM -0700, Priya Ahuja wrote:
> I am using version 2.20.1 logger utility to send logs to rsyslogd from
> bash scripts. I want to send logs in RFC5424 format with custom
> structured data fields, example: [sdid@enterprise-number level=INFO
> id=1234]. I understand 2.20.1 does not support 5424 format but I
> looked at the logger.c code in the latest version and seems structured
> data fields are set to [timeQuality tzKnown=\"1\" isSynced=\"1\"
> syncAccuracy=\"%ld\"]. Is there a way/plan to format custom structured
> data?
Implemented, for example:
logger --rfc5424 --sd-id zoo@123 \
--sd-param tiger=\"hungry\" \
--sd-param zebra=\"running\" \
--sd-id manager@123 \
--sd-param onMeeting=\"yes\" \
"this is message"
produces:
<13>1 2015-10-01T14:07:59.168662+02:00 ws kzak - - [timeQuality tzKnown="1" isSynced="1" syncAccuracy="218616"][zoo@123 tiger="hungry" zebra="running"][manager@123 onMeeting="yes"] this is message
The implementation also allows to specify standardized SD-ELEMENTs like
origin, meta and timeQuality (then build-in timeQuality is disabled).
It would be nice to test it against some advanced syslog.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2015-10-01 12:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-18 23:25 Custom structured data from logger utility Priya Ahuja
2015-09-19 8:50 ` Sami Kerola
2015-09-24 11:17 ` Karel Zak
2015-10-01 12:58 ` Karel Zak [this message]
2015-10-02 18:43 ` Priya Ahuja
2015-10-05 12:59 ` Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151001125840.GF1787@ws.net.home \
--to=kzak@redhat.com \
--cc=priahuja321@gmail.com \
--cc=ruediger.meier@ga-group.nl \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox