Skip to content

How do I send an event to splunk using the splunk_hec_logs sink but keep metadata as metadata? #23006

Answered by satellite-no
bcronrath asked this question in Q&A
Discussion options

You must be logged in to vote

the Splunk HEC logs sink has fields you can use to define. the metadata so if you had an event in vector that is

{
"message":"this is a tomato",
"index":"veggies",
"sourcetype":"tomato"
"timestamp": "2024-05-05T12:12:12Z"
}

and the splunk hec sink was

sinks:
  my_sink_id:
    type: splunk_hec_logs
    encoding:
      codec: text
    inputs:
      - my-source-or-transform-id
    compression: none
    endpoint: https://http-inputs-hec.splunkcloud.com
    endpoint_target: event
    index: "{{ index }}"
    sourcetype: "{{ sourcetype }}"
    timestamp_key: timestamp

it would send the value of .message to the index veggies, with a sourcetype of tomato.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pront
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
sink: splunk_hec Anything `splunk_hec` sink related
2 participants