Getting Data In

nodejs SplunkLogger - json message is not parsed

ngoodrich
New Member

I am using the manual batching example from the docs.

I am sending the following data to the logger.send function:

const obj = {
      oid: 'bluesun',
      tid: 'transaction_id',
      type: 'error',
      msg: 'I broke something bad'
    }

this.logger.send({
      message: obj,
      metadata: {
        source: 'awsBot',
        sourcetype: 'event-bus'
      },
      severity: 'error'
})

However, none of the fields in the json object appear to be parsed when coming into splunk.

This index is shared by other services that are logging in other formats so we can't override the entire index to expect json formatted messages, but is there a way to force these messages from this source to be parsed as json?

0 Karma

ngoodrich
New Member

@sdchakraborty That did not work.

0 Karma

sdchakraborty
Contributor

Hi,

will it be possible for you to make the sourcetype "_json"? That cloud resolve your issue.

Sid

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...