Splunk Search

Where to find some already created Splunk use cases for github webhook logs?

icehack
Observer

Does anyone know where I can find some already created Splunk use cases for github webhook logs?

I am having a really hard time googling for a dump of github based splunk searches because of the keyword github.

I am trying to look for commits in github with no approvals. I have identified the search for all commits and the search for finding approvals for those commits but I am unsure how to stich them together in a single query to produce actionable results.

The commit log and the approval log are separate logs but both have a unique identifier for the commit.

More info:

Here is the query for the approval and the corresponding log. These logs are heavily redacted and I am only including what is relevant. Logs come in through HEC so they are JSON.

 index=github action=submitted review.state=approved pull_request.head.sha!="" 

{
	action: submitted
	pull_request: {
		head: {
			sha: <commit-id>
		}
	}
	review: {
		state: approved
	}
}

Here is the log of the merge, it has no action so I'm using this query:

index=github after!="" 

{
	after: <commit-id>
	before: <previous-commit-id>
	enterprise: {}
	head_commit: {}
	organization: {}
	pusher: {}
	repository: {}
	sender: {}
}

I've been trying to create a table that includes both of these logs with no luck.

index=github after!="" 
[search index=github action=submitted review.state=approved pull_request.head.sha!="" 
|table pull_request.head.sha review.state 
| rename pull_request.head.sha as commit-id]
|table after 
|rename after as commit-id

So I am essentially looking for commit logs with no approval and trying to link the tables together with after/pull_request.head.sha as both of these values are unique commit ID's.

Ideally I would want to alert on each occurrence of an unapproved merge.

Labels (1)
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...