Monitoring Splunk

How do you run btool check against all apps in /opt/splunk/etc/deployment-apps?

crodri210
Explorer

I want to run btool check against all the apps in /opt/splunk/etc/deployment-apps. Is this possible?

Tags (2)
0 Karma
1 Solution

chrisyounger
SplunkTrust
SplunkTrust

You can actually use btool with the --dir option to run it against apps in different locations

https://docs.splunk.com/Documentation/Splunk/7.2.4/Troubleshooting/CommandlinetoolsforusewithSupport...

View solution in original post

chrisyounger
SplunkTrust
SplunkTrust

You can actually use btool with the --dir option to run it against apps in different locations

https://docs.splunk.com/Documentation/Splunk/7.2.4/Troubleshooting/CommandlinetoolsforusewithSupport...

crodri210
Explorer

I tried the following and did not see any results.

/opt/splunk/bin/splunk btool check --dir=/opt/splunk/etc/deployment-apps

Is this syntax correct?

0 Karma

chrisyounger
SplunkTrust
SplunkTrust

OK this is a bit dumb (and something I had forgotten), but btool --dir needs to be specified to the directory beneath "apps" folder and the folder needs to be called apps.

Here is a simple way to do it (uses a symbolic link):

cd /opt/splunk/etc/
mkdir deployment-apps-for-btool
cd deployment-apps-for-btool
ln -s /opt/splunk/etc/deployment-apps apps
/opt/splunk/bin/splunk btool  check --dir=/opt/splunk/etc/deployment-apps-for-btool/

crodri210
Explorer

Apparently you have to create another symbolic link for /opt/splunk/etc/system or else it won't work. So I did the following:

 cd /opt/splunk/etc/
 mkdir deployment-apps-for-btool
 cd deployment-apps-for-btool
 ln -s /opt/splunk/etc/deployment-apps apps
 ln -s /opt/splunk/etc/system system
 /opt/splunk/bin/splunk btool  check --dir=/opt/splunk/etc/deployment-apps-for-btool/

ddrillic
Ultra Champion

Not really - @chrisyoungerjds solution works exactly as prescribed. I tried it...

0 Karma

crodri210
Explorer

I'm running Splunk 7.2.1. It won't work without the system link. I tried it both ways...
# ls
apps deployment-apps system
# rm -f system
# /opt/splunk/bin/splunk btool check --dir=/tmp/staging
# /opt/splunk/bin/splunk -version
Splunk 7.2.1 (build be11b2c46e23)

Once I create a symbolic link to /opt/splunk/etc/system, it works again.

0 Karma

emikulic
Explorer

This is a poor workaround and results in errors in the btool.log for one.  This needs a better supported solution for checking deployment apps before they are pushed out (or after).

/opt/splunk/bin/splunk btool check --dir=/opt/splunk/etc/deployment-apps-symlink --debug | grep Splunk_TA_windows

Even with or without the symlink to 'system' under this new deployment-apps-symlink, there are btool errors about spec files either not being present, or being in the incorrect place as per.

 

 

0 Karma

chrisyounger
SplunkTrust
SplunkTrust

Hmm good to know. Thanks for sharing crodri210

0 Karma

ddrillic
Ultra Champion

Dead gorgeous @chrisyoungerjds - I ended up writing a python script that combined the serverclass data with the deployment apps to achieve a similar output for the migration we did recently.

Something equivalent to your - /opt/splunk/bin/splunk btool inputs list --dir=/opt/splunk/etc/deployment-apps-for-btool/

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

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 ...