<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic splunk-bunyan-logger logs in impractical format in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/splunk-bunyan-logger-logs-in-impractical-format/m-p/507847#M86425</link>
    <description>&lt;P&gt;I'm using&amp;nbsp;splunk-bunyan-logger to log to splunk. The example on&amp;nbsp;&lt;A href="https://github.com/splunk/splunk-bunyan-logger" target="_blank" rel="noopener"&gt;https://github.com/splunk/splunk-bunyan-logger&lt;/A&gt;&amp;nbsp;suggests using it like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Logger.info({
    message: {
        temperature: "70F",
        chickenCount: 500
    }
}, "Chicken coup looks stable.");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I'm using it like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;logger.info({ name, type: 'queryPerformance', ms }, `${name} took ${ms} ms`);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Despite not wrapping my own fields (name, type and ms) in a `message` object, in splunk, they do still end up in a message object. So I have to search by `message.type` instead of just `type`. Also, the text message ("Chicken coup looks stable" or `${name} took ${ms}`) does not show up anywhere at all.&lt;/P&gt;&lt;P&gt;Is there a better way to use&amp;nbsp;splunk-bunyan-logger to make it log the way I want it to?&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jul 2020 13:56:14 GMT</pubDate>
    <dc:creator>mcv</dc:creator>
    <dc:date>2020-07-07T13:56:14Z</dc:date>
    <item>
      <title>splunk-bunyan-logger logs in impractical format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/splunk-bunyan-logger-logs-in-impractical-format/m-p/507847#M86425</link>
      <description>&lt;P&gt;I'm using&amp;nbsp;splunk-bunyan-logger to log to splunk. The example on&amp;nbsp;&lt;A href="https://github.com/splunk/splunk-bunyan-logger" target="_blank" rel="noopener"&gt;https://github.com/splunk/splunk-bunyan-logger&lt;/A&gt;&amp;nbsp;suggests using it like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Logger.info({
    message: {
        temperature: "70F",
        chickenCount: 500
    }
}, "Chicken coup looks stable.");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I'm using it like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;logger.info({ name, type: 'queryPerformance', ms }, `${name} took ${ms} ms`);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Despite not wrapping my own fields (name, type and ms) in a `message` object, in splunk, they do still end up in a message object. So I have to search by `message.type` instead of just `type`. Also, the text message ("Chicken coup looks stable" or `${name} took ${ms}`) does not show up anywhere at all.&lt;/P&gt;&lt;P&gt;Is there a better way to use&amp;nbsp;splunk-bunyan-logger to make it log the way I want it to?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2020 13:56:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/splunk-bunyan-logger-logs-in-impractical-format/m-p/507847#M86425</guid>
      <dc:creator>mcv</dc:creator>
      <dc:date>2020-07-07T13:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: splunk-bunyan-logger logs in impractical format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/splunk-bunyan-logger-logs-in-impractical-format/m-p/507852#M86429</link>
      <description>The logger uses Splunk's HTTP Event Collector, which expects events in JSON format. See &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.4/Data/FormateventsforHTTPEventCollector" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.4/Data/FormateventsforHTTPEventCollector&lt;/A&gt;&lt;BR /&gt;The problem with using someone else's code is you're stuck with how they do it. To log the way you want to you'll need to write your own code, perhaps using the bunyan logger as a starting point.</description>
      <pubDate>Tue, 07 Jul 2020 14:10:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/splunk-bunyan-logger-logs-in-impractical-format/m-p/507852#M86429</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-07T14:10:45Z</dc:date>
    </item>
  </channel>
</rss>

