All Apps and Add-ons

Is there a simple way to source version, in github, a Splunk add-on project?

mferjani
New Member

Hi,
I've been working on an add-on that i created using Splunk add-on builder.

I would like to save the source code (data sources, python and shell) in Github so i can manage the versioning

Is there a simple way to do this ?

Thanks

0 Karma

koshyk
Super Champion

Should be straight forward. Hope you have an account in github?

  • Create project in github . (eg my_splunk_addon)
  • Do a clone of this to your laptop machine. (git clone https://github.com/yourid/my_splunk_addon.git )
  • This should create my_splunk_addon directory in your laptop/workstation.
  • Put your code in this directory
  • git add .
  • git commit -a -m "first update"
  • git push origin master

should be there in github as well.

(PS: might contain some mistakes, as I just typed on the fly without actually doing the commands)

0 Karma

mferjani
New Member

Hi,
Thanks for your response but what i was trying to do is to :
- Push my project $SPLUNK_HOME/etc/apps/TA_MyProject into github (Same as what you explained)
- Try to clone it into a new splunk instance, so my team-mates can work on it, commit and see changes
I tried locally by deleting the add-on and cloning the repo in $SPLUNK_HOME/etc/apps/ but my add-on does-not appear on splunk (after a restart)

0 Karma

koshyk
Super Champion

I would suggest against doing directly in etc/apps/ as that's your system folder. Ideally, the version control should be OUTSIDE system directories. Also , if you want a git directory, you need to do git init which might cause problems within system directory

So ideally, you want to put your version in some other directory
eg

/home/mferjani/splunk_code/TA_Myproject
git init 
git status
git commit -a -m "first update"
git push <github_location> master
Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...