Skip to main content
Solved

Webhook data feed

  • August 14, 2024
  • 3 replies
  • 398 views

Forum|alt.badge.img+6

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!

Best answer by mikewilusz

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

3 replies

mikewilusz
Staff
Forum|alt.badge.img+10
  • Staff
  • 108 replies
  • Answer
  • August 14, 2024

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


Forum|alt.badge.img+6
  • Author
  • Bronze 5
  • 13 replies
  • August 14, 2024

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)


mikewilusz
Staff
Forum|alt.badge.img+10
  • Staff
  • 108 replies
  • August 15, 2024

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

-mike