简体   繁体   English

从Splunk获取查询的Python脚本

[英]Python Script to Fetch Queries from Splunk

How can I use the urllib module in Python to get the HTML content from Splunk after logging in and running a query? 登录并运行查询后,如何在Python中使用urllib模块从Splunk获取HTML内容?

I understand we can do it by curl if we have CLI access. 我了解,如果我们具有CLI访问权限,则可以通过curl做到。 What about GUI? GUI呢?

Suppose I have my credentials and in one script it should return query after getting my credentials validated. 假设我有我的凭据,并且在一个脚本中,我的凭据经过验证后应该返回查询。

You probably want to use the Splunk SDK for Python, as doing all the parsing yourself will be a significant amount of work. 您可能想使用Splunk SDK for Python,因为您自己进行所有解析将需要大量工作。 There is some great documentation on the Python SDK here 有上了Python SDK一些伟大的文档在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM