<?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 Python SDK and Rest endpoint /search/jobs are not working as intended in setting ttl and querying custom parameters in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-and-Rest-endpoint-search-jobs-are-not-working-as/m-p/408189#M7067</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;We extensively use &lt;CODE&gt;splunklib.client&lt;/CODE&gt; and &lt;CODE&gt;service.jobs&lt;/CODE&gt; to &lt;STRONG&gt;create jobs&lt;/STRONG&gt;, &lt;STRONG&gt;retrieve jobs and iter over&lt;/STRONG&gt;, and &lt;STRONG&gt;set ttl&lt;/STRONG&gt;. All these things were working fine in Splunk 6.4.5 &amp;amp; Python SDK 1.6.2. &lt;/P&gt;

&lt;P&gt;In Splunk 7.0.7 &amp;amp; Python SDK 1.6.2, the service.jobs.iter(search=query) and job.set_ttl are not working. More details below.&lt;/P&gt;

&lt;P&gt;We post search jobs along with custom parameters. Later we retrieve the jobs matching some custom parameters.&lt;BR /&gt;
For example: If custom.notify_method="email", custom.notify_server="my mail server" are our custom parameters&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;query='custom.notify_method="email" AND custom.notify_server="my mail server"'
service.jobs.iter(search=query)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;returns nothing.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;for job in service.jobs:
    job.set_ttl(60)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The ttl  and eai:acl.ttl are set to 60. After 60 seconds, the ttl value becomes 0 but the eai:acl.ttl value remains as 60.&lt;BR /&gt;
The job never expires and it stays for 7 days.&lt;BR /&gt;
&lt;STRONG&gt;Why the jobs are not getting deleted after 60 seconds even though the ttl value has been updated to 0?&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Both the above mentioned issues are in &lt;CODE&gt;Splunk 7.0.7&lt;/CODE&gt; &amp;amp; &lt;CODE&gt;Python SDK 1.6.2&lt;/CODE&gt;. But they were working as intended in 6.4.5 and SDK 1.6.2&lt;/P&gt;

&lt;P&gt;Any pointers to solve these issues.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Strive&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 22:09:59 GMT</pubDate>
    <dc:creator>strive</dc:creator>
    <dc:date>2020-09-29T22:09:59Z</dc:date>
    <item>
      <title>Python SDK and Rest endpoint /search/jobs are not working as intended in setting ttl and querying custom parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-and-Rest-endpoint-search-jobs-are-not-working-as/m-p/408189#M7067</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;We extensively use &lt;CODE&gt;splunklib.client&lt;/CODE&gt; and &lt;CODE&gt;service.jobs&lt;/CODE&gt; to &lt;STRONG&gt;create jobs&lt;/STRONG&gt;, &lt;STRONG&gt;retrieve jobs and iter over&lt;/STRONG&gt;, and &lt;STRONG&gt;set ttl&lt;/STRONG&gt;. All these things were working fine in Splunk 6.4.5 &amp;amp; Python SDK 1.6.2. &lt;/P&gt;

&lt;P&gt;In Splunk 7.0.7 &amp;amp; Python SDK 1.6.2, the service.jobs.iter(search=query) and job.set_ttl are not working. More details below.&lt;/P&gt;

&lt;P&gt;We post search jobs along with custom parameters. Later we retrieve the jobs matching some custom parameters.&lt;BR /&gt;
For example: If custom.notify_method="email", custom.notify_server="my mail server" are our custom parameters&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;query='custom.notify_method="email" AND custom.notify_server="my mail server"'
service.jobs.iter(search=query)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;returns nothing.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;for job in service.jobs:
    job.set_ttl(60)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The ttl  and eai:acl.ttl are set to 60. After 60 seconds, the ttl value becomes 0 but the eai:acl.ttl value remains as 60.&lt;BR /&gt;
The job never expires and it stays for 7 days.&lt;BR /&gt;
&lt;STRONG&gt;Why the jobs are not getting deleted after 60 seconds even though the ttl value has been updated to 0?&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Both the above mentioned issues are in &lt;CODE&gt;Splunk 7.0.7&lt;/CODE&gt; &amp;amp; &lt;CODE&gt;Python SDK 1.6.2&lt;/CODE&gt;. But they were working as intended in 6.4.5 and SDK 1.6.2&lt;/P&gt;

&lt;P&gt;Any pointers to solve these issues.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Strive&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:09:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-and-Rest-endpoint-search-jobs-are-not-working-as/m-p/408189#M7067</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2020-09-29T22:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Python SDK and Rest endpoint /search/jobs are not working as intended in setting ttl and querying custom parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-and-Rest-endpoint-search-jobs-are-not-working-as/m-p/408190#M7068</link>
      <description>&lt;P&gt;Splunk team have told that it is a bug and it will be fixed.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 07:01:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Python-SDK-and-Rest-endpoint-search-jobs-are-not-working-as/m-p/408190#M7068</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2018-12-10T07:01:21Z</dc:date>
    </item>
  </channel>
</rss>

