<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Difficulty getting -auth option recognised in query via Python subprocess.call() in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Difficulty-getting-auth-option-recognised-in-query-via-Python/m-p/88176#M1267</link>
    <description>&lt;P&gt;Tom, thanks for the posting your observation here. It saved my day. I had been struggling with the same issue for quite some time now.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Aug 2013 21:50:59 GMT</pubDate>
    <dc:creator>rgamoji</dc:creator>
    <dc:date>2013-08-14T21:50:59Z</dc:date>
    <item>
      <title>Difficulty getting -auth option recognised in query via Python subprocess.call()</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Difficulty-getting-auth-option-recognised-in-query-via-Python/m-p/88174#M1265</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
I am experiencing difficulty entering credentials via -auth on a CLI query, when invoking via Python subprocess.call()&lt;/P&gt;

&lt;P&gt;If I run the following via terminal after restarting the Splunk daemon:&lt;/P&gt;

&lt;P&gt;splunk search "host=sampledata-1 sourcetype=access_combined_wcookie |outputcsv flowerseller.csv" -auth admin:changeme&lt;/P&gt;

&lt;P&gt;it does not prompt me for my credentials and the query executes. &lt;/P&gt;

&lt;P&gt;However, if I try and run query from a Python script using subprocess.call(), Splunk ignores/doesn't get the -auth and prompts me for my credentials on stdout. Once I enter the credentials the query executes. I have tried various permutations of quotes around the -auth, but can't get it to work.&lt;/P&gt;

&lt;P&gt;Can anyone show me what I am doing wrong? It maybe more of a Python/newbie issue but I'm hoping someone in the community has some experience of this type of scenario.&lt;/P&gt;

&lt;P&gt;(I know that there is a REST API for authentication, but I want to use the CLI for the moment)&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;

&lt;P&gt;T.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2013 12:59:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Difficulty-getting-auth-option-recognised-in-query-via-Python/m-p/88174#M1265</guid>
      <dc:creator>TomJordan</dc:creator>
      <dc:date>2013-04-09T12:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty getting -auth option recognised in query via Python subprocess.call()</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Difficulty-getting-auth-option-recognised-in-query-via-Python/m-p/88175#M1266</link>
      <description>&lt;P&gt;Sorry, found out what the problem was, I was entering "-auth admin:changeme" as a single string, it should have been:&lt;/P&gt;

&lt;P&gt;subprocess.call([path_to_splunk, "search", query, "-auth", "admin:changeme"])&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2013 13:20:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Difficulty-getting-auth-option-recognised-in-query-via-Python/m-p/88175#M1266</guid>
      <dc:creator>TomJordan</dc:creator>
      <dc:date>2013-04-09T13:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty getting -auth option recognised in query via Python subprocess.call()</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Difficulty-getting-auth-option-recognised-in-query-via-Python/m-p/88176#M1267</link>
      <description>&lt;P&gt;Tom, thanks for the posting your observation here. It saved my day. I had been struggling with the same issue for quite some time now.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2013 21:50:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Difficulty-getting-auth-option-recognised-in-query-via-Python/m-p/88176#M1267</guid>
      <dc:creator>rgamoji</dc:creator>
      <dc:date>2013-08-14T21:50:59Z</dc:date>
    </item>
  </channel>
</rss>

