Monitoring Splunk
Highlighted

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

Explorer

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

Tags (2)
0 Karma
Highlighted

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

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

Highlighted

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

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
Highlighted

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

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/
Highlighted

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

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
Highlighted

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

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/
0 Karma
Highlighted

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

Ultra Champion

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

0 Karma
Highlighted

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

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
Highlighted

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

SplunkTrust
SplunkTrust

Hmm good to know. Thanks for sharing crodri210

0 Karma
Speak Up for Splunk Careers!

We want to better understand the impact Splunk experience and expertise has has on individuals' careers, and help highlight the growing demand for Splunk skills.