Template for python data pusher

Init

On the splunk side you have to set up a index once you have made a index you need to configure it with the index it will be one of the options when setting up a HEC

  1. set up a index

  2. setup a HEC

Scripts

The script below is a template to test if any data will push. I am doing it with a weather API

There is some data that needs to be set up

  • splunk_url is the IP of the server

  • splunk_token is the token that gets generated with when creating a HEC server

splunk_url = "https://<splunk-ip>:8088/services/collector/event"
splunk_token = "<generated-token-from-HEC>"  # HEC HTTP token

For this instance you need to go to:

Make a free account and put the API key and zip code to make this work

The below script set to run every hour the script above only will run once

Last updated