2019年3月23日土曜日

sleep.py

Sleepするだけのカスタムコマンド作りたい


要KAIZEN


import splunk.Intersplunk
import time

if __name__ == '__main__':
    keywords,options = splunk.Intersplunk.getKeywordsAndOptions()
    sec = options.get('sec', '10')
    sec = int(sec)
    time.sleep(sec)
    results,dummyresults,settings = splunk.Intersplunk.getOrganizedResults()
    splunk.Intersplunk.outputResults(results)

サブサーチは何階層でもいけると思っていた

ことの始まり

どこかのお客さんに対して、
「サブサーチのネストは何階層でもいけますよ。メモリの許す限り」
的な発言をした記憶があったのだけど、limits.conf を眺めていたら Default で8階層だということをいま知った。

limits.conf.spec をみる

max_subsearch_depth = <int>* Maximum recursion depth for subsearches. Specifies the maximum levels for  subsearches.* It is considered a search exception if a subsearch does not stop after  this many levels.* Default: 8

一応、Default値があるというだけで制限値は書かれていないので、完全に間違った発言ではなかったと言い逃れしておきたい

制限超えるとどうなるか

単にエラーになるだけ。エラーメッセージが limits.conf をみるように促してくれるといいのに