All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: "Qi, Fuli" <qi.fuli@jp.fujitsu.com>
Cc: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [RFC PATCH v2 0/7] ndctl: nvdimmd: notify/monitor the feathers of over threshold event
Date: Thu, 7 Dec 2017 11:34:03 -0800	[thread overview]
Message-ID: <CAPcyv4iG2bGi3bhkPss_OwWewDD=JZ+b6mOiUj6=Enj7_s43LA@mail.gmail.com> (raw)
In-Reply-To: <b025ae2f-0196-8d00-6b3b-aad7c4e23d54@jp.fujitsu.com>

On Thu, Dec 7, 2017 at 1:58 AM, Qi, Fuli <qi.fuli@jp.fujitsu.com> wrote:
[..]
>> Ok, I will make a sample hook up to Fluentd.
>>
>>
> I tried to hook up the current json format output to Fluentd,
> Fluentd parsed each line in the output as a new event.
> The current json format output cannot be consumed by Fluentd without
> any plugins. This is undesired.
> So I changed the multiline json format output to one-line like the following
> sample, then Fluentd parsed it well.
>
> {"datetime":"2017/11/28 11:00:12","pid":7013,"dev":"nmem1","health":{"health_state":"non-critical","temperature_celsius":23,"spares_percentage":75","life_used_percentage":5,"shutdown_state":"clean"}}
>
> I think one-line output will get consumed more easily by other data collect
> services besides Fluentd. All the output items should be placed in json block,
> such as datetime, eventid.
>
> So I would like to change current multi-line json format output to one line
> and move all items into json block.
>

This is just a small matter of using the JSON_C_TO_STRING_PLAIN flag
instead of JSON_C_TO_STRING_PRETTY when emitting json
(json_object_to_json_string_ext()) for Fluentd or another service to
consume.

Also, when creating a json record for Fluentd I think the standard
record that ndctl list reports should be wrapped as a sub-object i.e:

{
  "dev":"nmem3",
  "id":"cdab-0a-07e0-feffffff",
  "handle":1,
  "phys_id":1,
  "health":{
    "health_state":"non-critical",
    "temperature_celsius":23,
    "spares_percentage":75,
    "alarm_temperature":true,
    "alarm_spares":true,
    "temperature_threshold":80.125,
    "spares_threshold":128,
    "life_used_percentage":5,
    "shutdown_state":"clean"
  }
}

...becomes:

{
  "timestamp":"YYYY/MM/DD HH:mm:ss",
  "pid":1234,
  {
    "dev":"nmem3",
    "id":"cdab-0a-07e0-feffffff",
    "handle":1,
    "phys_id":1,
    "health":{
      "health_state":"non-critical",
      "temperature_celsius":23,
      "spares_percentage":75,
      "alarm_temperature":true,
      "alarm_spares":true,
      "temperature_threshold":80.125,
      "spares_threshold":128,
      "life_used_percentage":5,
      "shutdown_state":"clean"
    }
  }
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2017-12-07 19:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-14  7:46 [RFC PATCH v2 0/7] ndctl: nvdimmd: notify/monitor the feathers of over threshold event QI Fuli
2017-11-14  7:46 ` [RFC PATCH v2 1/7] ndctl: nvdimmd: add LOG_NOTICE level into log_priority QI Fuli
2017-11-14  7:46 ` [RFC PATCH v2 2/7] ndctl: nvdimmd: add nvdimmd necessary util functions QI Fuli
2017-11-20 21:19   ` Dan Williams
2017-12-06  7:14     ` Qi, Fuli
2017-12-06 16:53       ` Dan Williams
2017-12-07  9:55         ` Qi, Fuli
2017-12-09 23:54           ` Dan Williams
2017-11-14  7:47 ` [RFC PATCH v2 3/7] ndctl: nvdimmd: add nvdimmd necessary functions QI Fuli
2017-11-14  7:47 ` [RFC PATCH v2 4/7] ndctl: nvdimmd: add body file of nvdimm daemon QI Fuli
2017-11-20 21:31   ` Dan Williams
2017-11-14  7:47 ` [RFC PATCH v2 5/7] ndctl: nvdimmd: add nvdimmd config file QI Fuli
2017-11-14  7:47 ` [RFC PATCH v2 6/7] ndctl: nvdimmd: add the unit file of systemd for nvdimmd service QI Fuli
2017-11-14  7:47 ` [RFC PATCH v2 7/7] ndctl: nvdimmd: add a temporary test for nvdimm daemon QI Fuli
2017-11-20  6:33 ` [RFC PATCH v2 0/7] ndctl: nvdimmd: notify/monitor the feathers of over threshold event Dan Williams
2017-11-20 10:07   ` Yasunori Goto
2017-11-20 16:13     ` Dan Williams
2017-11-21  1:59       ` Qi, Fuli
2017-12-07  9:58         ` Qi, Fuli
2017-12-07 19:34           ` Dan Williams [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-11-14  2:04 [RFC patch " Qi, Fuli
2017-11-14  7:58 ` Qi, Fuli

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='CAPcyv4iG2bGi3bhkPss_OwWewDD=JZ+b6mOiUj6=Enj7_s43LA@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=qi.fuli@jp.fujitsu.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.