Skip to main content
Question

Passing the message field in JSON to Splunk

  • Mar 11, 2025 3:17 AM UTC
  • 15 replies
  • 201 views

I'm having trouble getting the JSON under the "message" field recognized in splunk. Is there something simple I'm missing on the Cribl side of things to break this json out of message, or only keep the JSON in the message as the event?

15 replies

Jon Rust
Forum|alt.badge.img
  • Employee
  • Mar 11, 2025 4:15 AM UTC

is _raw shown as `a` or `{}`?


  • Author
  • Employee
  • Mar 11, 2025 4:15 AM UTC

α


Jon Rust
Forum|alt.badge.img
  • Employee
  • Mar 11, 2025 4:15 AM UTC

Try this:Parser function-> source _raw-> destination _raw-> JSON-> extract


Jon Rust
Forum|alt.badge.img
  • Employee
  • Mar 11, 2025 4:15 AM UTC

now _raw should be `{}`if yes, is message also `{}`, or still `a`?


Jon Rust
Forum|alt.badge.img
  • Employee
  • Mar 11, 2025 4:15 AM UTC

add another parser-> source _raw.message-> destination _raw,message-> JSON-> extract


  • Author
  • Employee
  • Mar 11, 2025 4:15 AM UTC

_raw is now `{}`message is still `a`


Jon Rust
Forum|alt.badge.img
  • Employee
  • Mar 11, 2025 4:15 AM UTC

my bet is that the message field was escaped (double escaped?) JSON


Jon Rust
Forum|alt.badge.img
  • Employee
  • Mar 11, 2025 4:15 AM UTC

with the 2nd parser, is it showing as `{}`?


  • Author
  • Employee
  • Mar 11, 2025 4:15 AM UTC

yes it is


Jon Rust
Forum|alt.badge.img
  • Employee
  • Mar 11, 2025 4:15 AM UTC

noice


Jon Rust
Forum|alt.badge.img
  • Employee
  • Mar 11, 2025 4:15 AM UTC

should be good to send to splunk now


Jon Rust
Forum|alt.badge.img
  • Employee
  • Mar 11, 2025 4:15 AM UTC

(to be safe, i'd probably add a final function, Serialize, to turn _raw (all of it) back into a string):


Jon Rust
Forum|alt.badge.img
  • Employee
  • Mar 11, 2025 4:15 AM UTC

this time though, it will only be 1 level of stringification, so splunk will handle it


  • Author
  • Employee
  • Mar 11, 2025 4:15 AM UTC

it took a minute but looks great in Splunk now


  • Author
  • Employee
  • Mar 11, 2025 4:15 AM UTC

Thanks for the help!