<?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: Trying to download splunk logs using python script using bamboo in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-download-splunk-logs-using-python-script-using-bamboo/m-p/743245#M241064</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/309019"&gt;@Hemanth35&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Based on the logs, your Python script (licensecode.py) successfully initiates a Splunk search but then gets stuck in a waiting loop (Waiting next 10 seconds for all queries to complete) until it hits its internal 200-second timeout. This usually means the script is either not correctly checking if the Splunk search job has finished, or the search itself is taking longer than 200 seconds to complete.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Check Search Performance:&lt;/STRONG&gt; Run the search search eventtype="cba-env-prod" NNO.API.LOG.PM.UPDATE latest=now earliest=-7d directly in the Splunk Search UI. Note how long it takes to complete. If it takes longer than 200 seconds, you'll need to either optimize the search or increase the timeout in your Python script.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Review Python Script Logic:&lt;/STRONG&gt; Examine the licensecode.py script, particularly the loop that waits for the search to complete (around line 265) and the logic that triggers the search and should check its status (around lines 193-201).&lt;/LI&gt;&lt;OL&gt;&lt;LI&gt;Ensure the script correctly polls the Splunk search job's status using its SID (1743587848.2389422_84B919DD-8E60-47EE-AF06-F6EE20B95178). It should check if the job's dispatchState is DONE, FAILED, or still running (See&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.4.1/RESTTUT/RESTsearches#:~:text=dispatchState-,dispatchState,-is%20one%20of" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/9.4.1/RESTTUT/RESTsearches#:~:text=dispatchState-,dispatchState,-is%20one%20of&lt;/A&gt;)&lt;/LI&gt;&lt;LI&gt;Verify that once the job is DONE, the script proceeds to retrieve the results using the appropriate Splunk SDK method or REST API endpoint.&lt;/LI&gt;&lt;LI&gt;Add more detailed logging within the loop to print the actual status&amp;nbsp;returned by Splunk for the job SID during each check. This will help diagnose if the status check logic is flawed.&lt;/LI&gt;&lt;/OL&gt;&lt;LI&gt;&lt;STRONG&gt;Increase Script Timeout:&lt;/STRONG&gt;&lt;SPAN&gt; If the search legitimately takes longer than 200 seconds, modify the timeout value within your &lt;/SPAN&gt;&lt;SPAN&gt;script&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt; &lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt; If so, please consider:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;Adding kudos to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 02 Apr 2025 11:31:35 GMT</pubDate>
    <dc:creator>livehybrid</dc:creator>
    <dc:date>2025-04-02T11:31:35Z</dc:date>
    <item>
      <title>Trying to download splunk logs using python script using bamboo</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-download-splunk-logs-using-python-script-using-bamboo/m-p/743239#M241062</link>
      <description>&lt;P&gt;when running my bamboo paln i am unable to generate splunk log json file&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is log&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;build	02-Apr-2025 11:57:27	/home/bamboo-agent/xml-data/build-dir/CBPPOC-SLPIB-JOB1/dbscripts
build	02-Apr-2025 11:57:27	_bamboo_build.sh
build	02-Apr-2025 11:57:27	_build.sh
build	02-Apr-2025 11:57:27	licensecode.py
build	02-Apr-2025 11:57:27	_push2release.sh
build	02-Apr-2025 11:57:27	_push2snapshot.sh
build	02-Apr-2025 11:57:27	splunkQueries.txt
build	02-Apr-2025 11:57:28	[licensecode.py:43 - login() ] Logging in to Splunk API initiated
build	02-Apr-2025 11:57:28	[licensecode.py:62 - login() ] Logged in as: M022754
build	02-Apr-2025 11:57:28	[licensecode.py:257 - main() ] Command line param queryFile has value: splunkQueries.txt
build	02-Apr-2025 11:57:28	[licensecode.py:159 - processQueryFile() ] Query: search eventtype="cba-env-prod" NNO.API.LOG.PM.UPDATE latest=now earliest=-7d
build	02-Apr-2025 11:57:28	[licensecode.py:161 - processQueryFile() ] Number of queries in queue: 1
build	02-Apr-2025 11:57:28	[licensecode.py:193 - triggerSearch() ] Triggering search for query: search eventtype="cba-env-prod" NNO.API.LOG.PM.UPDATE latest=now earliest=-7d
build	02-Apr-2025 11:57:28	[licensecode.py:201 - triggerSearch() ] Search initiated with SID: 1743587848.2389422_84B919DD-8E60-47EE-AF06-F6EE20B95178
build	02-Apr-2025 11:57:38	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 11:57:48	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 11:57:58	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 11:58:08	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 11:58:18	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 11:58:28	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 11:58:38	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 11:58:48	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 11:58:58	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 11:59:08	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 11:59:18	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 11:59:28	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 11:59:38	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 11:59:48	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 11:59:58	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 12:00:08	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 12:00:18	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 12:00:28	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 12:00:38	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 12:00:48	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 12:00:58	[licensecode.py:265 - main() ] Waiting next 10 seconds for all queries to complete
build	02-Apr-2025 12:00:58	[licensecode.py:268 - main() ] Execution timeout of 200 seconds has passed, exiting
simple	02-Apr-2025 12:00:58	Failing task since return code of [/home/bamboo-agent/temp/CBPPOC-SLPIB-JOB1-268-ScriptBuildTask-11226880290426353947.sh] was 1 while expected 0&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;02-Apr-2025 12:00:58&lt;/TD&gt;&lt;TD&gt;Failing as no matching files has been found and empty artifacts are not allowed.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;after completing waiting time logs file json not generating&lt;BR /&gt;help me to how to resolve this issue&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 11:01:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-download-splunk-logs-using-python-script-using-bamboo/m-p/743239#M241062</guid>
      <dc:creator>Hemanth35</dc:creator>
      <dc:date>2025-04-02T11:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to download splunk logs using python script using bamboo</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Trying-to-download-splunk-logs-using-python-script-using-bamboo/m-p/743245#M241064</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/309019"&gt;@Hemanth35&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Based on the logs, your Python script (licensecode.py) successfully initiates a Splunk search but then gets stuck in a waiting loop (Waiting next 10 seconds for all queries to complete) until it hits its internal 200-second timeout. This usually means the script is either not correctly checking if the Splunk search job has finished, or the search itself is taking longer than 200 seconds to complete.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Check Search Performance:&lt;/STRONG&gt; Run the search search eventtype="cba-env-prod" NNO.API.LOG.PM.UPDATE latest=now earliest=-7d directly in the Splunk Search UI. Note how long it takes to complete. If it takes longer than 200 seconds, you'll need to either optimize the search or increase the timeout in your Python script.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Review Python Script Logic:&lt;/STRONG&gt; Examine the licensecode.py script, particularly the loop that waits for the search to complete (around line 265) and the logic that triggers the search and should check its status (around lines 193-201).&lt;/LI&gt;&lt;OL&gt;&lt;LI&gt;Ensure the script correctly polls the Splunk search job's status using its SID (1743587848.2389422_84B919DD-8E60-47EE-AF06-F6EE20B95178). It should check if the job's dispatchState is DONE, FAILED, or still running (See&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.4.1/RESTTUT/RESTsearches#:~:text=dispatchState-,dispatchState,-is%20one%20of" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/9.4.1/RESTTUT/RESTsearches#:~:text=dispatchState-,dispatchState,-is%20one%20of&lt;/A&gt;)&lt;/LI&gt;&lt;LI&gt;Verify that once the job is DONE, the script proceeds to retrieve the results using the appropriate Splunk SDK method or REST API endpoint.&lt;/LI&gt;&lt;LI&gt;Add more detailed logging within the loop to print the actual status&amp;nbsp;returned by Splunk for the job SID during each check. This will help diagnose if the status check logic is flawed.&lt;/LI&gt;&lt;/OL&gt;&lt;LI&gt;&lt;STRONG&gt;Increase Script Timeout:&lt;/STRONG&gt;&lt;SPAN&gt; If the search legitimately takes longer than 200 seconds, modify the timeout value within your &lt;/SPAN&gt;&lt;SPAN&gt;script&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt; &lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt; If so, please consider:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;Adding kudos to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 02 Apr 2025 11:31:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Trying-to-download-splunk-logs-using-python-script-using-bamboo/m-p/743245#M241064</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-04-02T11:31:35Z</dc:date>
    </item>
  </channel>
</rss>

