标签:local /dev/null curl mode sid ati result document localhost
如下:
curl -u admin:changeme -k https://localhost:8089/services/search/jobs -d search="search source=\"http:hec_test\" | head 5" curl -u admin:changeme -k https://localhost:8089/services/search/jobs/1481684877.17/results/ --get -d output_mode=csv
更智能点:
sid=`curl -u admin:changeme -k https://localhost:8089/services/search/jobs -d search="search source=\"http:hec_test\" refresh" 2>/dev/null | sed "1,2d" | sed "2d" | sed "s/.*>\([0-9]*\.[0-9]*\)<.*/\1/"` echo $sid curl -u admin:changeme -k https://localhost:8089/services/search/jobs/$sid/results/ --get -d output_mode=json 2>/dev/null >out.json
参考:http://docs.splunk.com/Documentation/Splunk/6.5.1/RESTTUT/RESTsearches
标签:local /dev/null curl mode sid ati result document localhost
原文地址:http://www.cnblogs.com/bonelee/p/6178680.html