Splunk Enterprise

Compare github repos using splunk?

karthi2809
Contributor

Hi ,

Thanks in Advance,

We have requirement that the  two github repos are in two (eg: USA and Canada)different country.so every day we replicate code. The monitoring script would be created, which will compare the USA and Canada repositories. This script will be executed as part of code replication pipelines. The comparison result generated by script, would be saved in a log file. This log file would then be sent to Splunk using Splunk Forwarder. . Alerts would be created in Splunk to send automated email. These alerts would get triggered if any differences are identified b/w the repositories based on the log data sent to Splunk.

Is there any way to compare two repos using splunk app directly

 

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Splunk does not have a native interface to Git/github.  You could, however, set up a scripted input that compares the two repositories and reports on the differences found.  The output of that script would be indexed automatically by Splunk, eliminating the need for a log file and a forwarder.  Once the data is ingested then searches can be run to potentially trigger alerts.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

Azeemering
Builder

Yes it seems possible.

I have built a similar app that check if a github app is set to public by accident using the github api. You can create an app that polls the api and ingests any changes in the repo.
You could apply the same priniciple by ingesting both repos and create a compare search in Splunk.

 

pavanbits1990
New Member
Splunk Phantom also uses a Git repository to publish company-authored playbooks for customers to download. This repository is called the community repository and is configured on Splunk Phantom by default.
 
 
 
0 Karma

VatsalJagani
Champion

@karthi2809 - I think what you are currently doing with the script is more appropriate architecturely.

Even if you were to do it in Splunk, I would have suggested doing it in module input's python and you end up doing the same thing. You can do this if you want. It's basically the same thing as what you are doing today.

 

I hope this helps!!!

richgalloway
SplunkTrust
SplunkTrust

Splunk does not have a native interface to Git/github.  You could, however, set up a scripted input that compares the two repositories and reports on the differences found.  The output of that script would be indexed automatically by Splunk, eliminating the need for a log file and a forwarder.  Once the data is ingested then searches can be run to potentially trigger alerts.

---
If this reply helps you, Karma would be appreciated.

karthi2809
Contributor

How it will send the data automatically?

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

It's Splunk magic.  😉  Anything a scripted or modular input writes to stdout is saved in an index.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

How I Instrumented a Rust Application Without Knowing Rust

As a technical writer, I often have to edit or create code snippets for Splunk's distributions of ...

Splunk Community Platform Survey

Hey Splunk Community, Starting today, the community platform may prompt you to participate in a survey. The ...

Observability Highlights | November 2022 Newsletter

 November 2022Observability CloudEnd Of Support Extension for SignalFx Smart AgentSplunk is extending the End ...