title: How to log JSON to console and get cloudwatch logs pick up correct metadata?
body: <pre><code>winston.info('Hello again distributed logs', { app: 'test', sid: 1 })
  pino.info('Hello again distributed logs', { app: 'test', sid: 1 })
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>{"app":"test","sid":1,"level":"info","message":"Hello again distributed logs","timestamp":"2017-02-16T03:34:06.186Z"}
  {"pid":4269,"hostname":"Macchiato.local","level":30,"time":1487216046197,"msg":"Hello again distributed logs {\"app\":\"test\",\"sid\":1}","v":1}
  </code></pre>
  
  <p>I have fluentd daemon to pickup container stdout and ship it to cloudwatch.</p>
  
  <p>In the example above, cloudwatchlogs can detect the metadata correctly from <a href="https://github.com/pinojs/pino" rel="nofollow noreferrer">pino</a> and I will be able to query the log like this</p>
  
  <pre><code>{$.app = "test"}
  </code></pre>
  
  <p>However, winston console is not working like that and everything got push to <code>log</code> attribute.</p>
  
  <p>Does anyone know how to fix this. I'm using winston console with <code>json: true</code> and <code>stringify: true</code></p>