Skip to main content

Hi everyone,

I'm trying to ingest logs into Chronicle via a webhook Data feed, but I'm unsure how the API call should be structured on the client side that is push these logs. Could anyone provide documentation or an example of how this would look in a Python script?

Thanks for your help!

The documentation for webhooks includes examples of how to pass auth parameters. These can come in via headers or directly in the URL as parameters: https://cloud.google.com/chronicle/docs/administration/feed-management#webhook-endpoint-url


-mike


The documentation for webhooks includes examples of how to pass auth parameters. These can come in via headers or directly in the URL as parameters: https://cloud.google.com/chronicle/docs/administration/feed-management#webhook-endpoint-url


-mike


Thx @mikewilusz for the swift response. So python script that sends logs to that webhook feed yould look like this ? 

import requests

# Webhook endpoint URL
url = "https://Webhook-feed-endpoint.com"

# Data to send in the POST request
data = {
"key1": "value1",
"key2": "value2"
}

# Custom headers
headers = {
"X-goog-api-key" = API_KEY
"X-Webhook-Access-Key" = SECRET
}

# Sending the POST request with custom headers
response = requests.post(url, json=data, headers=headers)

# Check the response status code and content
print("Status Code:", response.status_code)
print("Response Body:", response.text)


As we say here at Google: LGTM! (looks good to me)


-mike


Reply