Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Latest commit

 

History

History
43 lines (30 loc) · 1.05 KB

rest-event-to-splunk.md

File metadata and controls

43 lines (30 loc) · 1.05 KB

REST to Splunk

Integration that creates a REST endpoint and resends it to Splunk's HTTP Event Collector (HEC).

Prerequisites

  • Kubernetes/OpenShift cluster
  • CamelK operator installed (kamel install)
  • HTTP Event Collector set up in Splunk

Running

Before running, please update the file with the HEC token by replacing PASTETOKENHERE and setting Splunk's hostname by replacing SPLUNKHOST!

$ kamel run rest-event-to-splunk.groovy [--dev]

The REST endpoint created by the Integration is POST /event.

Trying it out

Set up port forwarding from the cluster:

oc port-forward service/rest-event-to-splunk 8111:80

Send an event with POST using curl:

$ curl http://localhost:8111/event \
    -H "Content-Type: application/json" \
    -d '{"event": "Test"}'

Pay attention to the Content-Type which needs to be set for Camel to recognize the message body.