<?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: Use Python API on a query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Use-Python-API-on-a-query/m-p/696864#M236819</link>
    <description>&lt;P&gt;1. This search is not proper SPL. The quotes don't add up so it's not obvious if you're quoting whole search or indeed have unneeded quotes in it.&lt;/P&gt;&lt;P&gt;2. Are you sure you're not forgetting about escaping quotes in your string containing search?&lt;/P&gt;&lt;P&gt;3. On Splunk's side, back around 8.0 or even a bit after that the order of arguments with bin and timechart was important. You needed to put the "span=12h" as the first parameter immediately after the command. With sufficiently modern Splunk version it's more lenient to just placing the span parameter almost anywhere.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2024 15:23:04 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-08-20T15:23:04Z</dc:date>
    <item>
      <title>Use Python API on a query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-Python-API-on-a-query/m-p/696843#M236816</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a query used on Splunk enterprise web (search)-&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt; "index="__eit_ecio*"  | ... | bin _time span=12h | ... | table ... |&lt;/LI-CODE&gt;
&lt;P&gt;I am trying to put that into a python API code using Job class as this -&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;searchquery_oneshot ="&amp;lt;my above query&amp;gt;"&lt;/LI-CODE&gt;
&lt;P&gt;I am getting error - "SyntaxError: invalid decimal literal" pointing to the 12h&amp;nbsp;&amp;nbsp;in main query.&lt;/P&gt;
&lt;P&gt;How can I fix this?&lt;/P&gt;
&lt;P&gt;[2) Can I direct "collect" results (summary index) via this API into json format?]&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 14:15:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-Python-API-on-a-query/m-p/696843#M236816</guid>
      <dc:creator>MK3</dc:creator>
      <dc:date>2024-08-20T14:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Use Python API on a query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-Python-API-on-a-query/m-p/696864#M236819</link>
      <description>&lt;P&gt;1. This search is not proper SPL. The quotes don't add up so it's not obvious if you're quoting whole search or indeed have unneeded quotes in it.&lt;/P&gt;&lt;P&gt;2. Are you sure you're not forgetting about escaping quotes in your string containing search?&lt;/P&gt;&lt;P&gt;3. On Splunk's side, back around 8.0 or even a bit after that the order of arguments with bin and timechart was important. You needed to put the "span=12h" as the first parameter immediately after the command. With sufficiently modern Splunk version it's more lenient to just placing the span parameter almost anywhere.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 15:23:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-Python-API-on-a-query/m-p/696864#M236819</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-08-20T15:23:04Z</dc:date>
    </item>
  </channel>
</rss>

