LoginSignup
0
0

CLIでsplunkコマンド実行時の時刻がわかるようにする(小ネタ)

Posted at

splunkコマンドの実行エビデンスを残す必要がある時や、splunk自身の調査をする状況において(splunkを)何時停止したっけ?とかを確認したい時に、
以下の内容を.bashrcや.zshrcに仕込んでおくだけで少し幸せになれます。

.bashrcとか.zshrc
function splunk(){
    date;/opt/splunk/bin/splunk $@ ;date
}
実行例
$ splunk restart
2024年 1月 17日 水曜日 11時52分47秒 JST ← コマンド実行直前の時間が出るようになる
Stopping splunkd...
Shutting down.  Please wait, as this may take a few minutes.
.....
Stopping splunk helpers...

Done.

(中略)

Waiting for web server at http://127.0.0.1:8000 to be available..................................... Done


If you get stuck, we're here to help.
Look for answers here: http://docs.splunk.com

The Splunk web interface is at http://C02DH0Y8ML7J:8000

2024年 1月 17日 水曜日 11時53分53秒 JST ← コマンド完了直後の時間が出るようになる
$
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0