<?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: search results different between splunk UI/portal and splunk API in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747304#M241795</link>
    <description>&lt;P&gt;when i look at the _time which is pulled through API values look like below&lt;BR /&gt;_time&lt;BR /&gt;2025-05-30 10:28:06.234 UTC&lt;BR /&gt;2025-05-30 04:48:45.178 UTC&lt;BR /&gt;2025-05-30 16:33:09.755 UTC&lt;BR /&gt;2025-05-30 14:20:23.054 UTC&lt;/P&gt;</description>
    <pubDate>Sat, 31 May 2025 18:42:03 GMT</pubDate>
    <dc:creator>Raj_Splunk_Ing</dc:creator>
    <dc:date>2025-05-31T18:42:03Z</dc:date>
    <item>
      <title>search results different between splunk UI/portal and splunk API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747302#M241793</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I have this very simple splunk search query and i was able to run in splunk search portal or UI and I am using the same search query API (using the same query but in the form of encoded URL) - what is the issue?&lt;BR /&gt;I am getting total number of events as 164 in splunk portal but when i run the same query which is transted into encoded URL through python script i am getting 157 records/rows only...&lt;/P&gt;&lt;P&gt;since this search is only for yesterday iam using&amp;nbsp;&lt;STRONG&gt;earliest=-1d@d latest=-0d@d&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;index=App001_logs&lt;BR /&gt;sourcetype="App001_logs_st"&lt;BR /&gt;&lt;STRONG&gt;earliest=-1d@d latest=-0d@d&lt;/STRONG&gt;&lt;BR /&gt;organization IN ("InternalApps","ExternalApps")&lt;BR /&gt;AppclientId="ABC123"&lt;BR /&gt;status_code=200&lt;BR /&gt;environment="UAT"&lt;BR /&gt;| table _time, AppclientId,organization,environment,proxyBasePath,api_name&lt;/P&gt;&lt;P&gt;the same exact query which is translated in encoded URL like https:// whole search query&lt;/P&gt;&lt;P&gt;and when i run the python script in my desktop (my time zone is CST) i get only 157 records/rows&lt;BR /&gt;&lt;BR /&gt;I think there is something going on UTC and CST -&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;this is what i see in splunk portal 164&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;events&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(5/30/25 12:00:00.000 AM to 5/31/25 12:00:00.000 AM)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;any guidance please?&lt;/P&gt;</description>
      <pubDate>Sat, 31 May 2025 18:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747302#M241793</guid>
      <dc:creator>Raj_Splunk_Ing</dc:creator>
      <dc:date>2025-05-31T18:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: search results different between splunk UI/portal and splunk API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747303#M241794</link>
      <description>&lt;P&gt;when i look at the last row/record and look for _time the value it has is&amp;nbsp;&lt;STRONG&gt;2025-05-30 23:30:28.314&lt;BR /&gt;there&amp;nbsp;&lt;/STRONG&gt;is no record after this&lt;/P&gt;</description>
      <pubDate>Sat, 31 May 2025 18:36:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747303#M241794</guid>
      <dc:creator>Raj_Splunk_Ing</dc:creator>
      <dc:date>2025-05-31T18:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: search results different between splunk UI/portal and splunk API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747304#M241795</link>
      <description>&lt;P&gt;when i look at the _time which is pulled through API values look like below&lt;BR /&gt;_time&lt;BR /&gt;2025-05-30 10:28:06.234 UTC&lt;BR /&gt;2025-05-30 04:48:45.178 UTC&lt;BR /&gt;2025-05-30 16:33:09.755 UTC&lt;BR /&gt;2025-05-30 14:20:23.054 UTC&lt;/P&gt;</description>
      <pubDate>Sat, 31 May 2025 18:42:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747304#M241795</guid>
      <dc:creator>Raj_Splunk_Ing</dc:creator>
      <dc:date>2025-05-31T18:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: search results different between splunk UI/portal and splunk API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747305#M241796</link>
      <description>&lt;P&gt;If you suspect there's some time range discrepancy between those two searches, check their job logs. After the search is expanded as it's being dispatched to be executed, if I remember correctly it should have the earliest and latest as epoch-based timestamps. Check if they differ.&lt;/P&gt;&lt;P&gt;I assume you're spawning the searches from the same user, aren't you?&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jun 2025 05:02:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747305#M241796</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-06-01T05:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: search results different between splunk UI/portal and splunk API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747312#M241798</link>
      <description>&lt;P&gt;Hi Rick, same user. i did use the earliest and latest in the search query itself as filters. API is using the services/export&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jun 2025 14:55:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747312#M241798</guid>
      <dc:creator>Raj_Splunk_Ing</dc:creator>
      <dc:date>2025-06-01T14:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: search results different between splunk UI/portal and splunk API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747317#M241799</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/273058"&gt;@Raj_Splunk_Ing&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;This is generally because API call normally defaults to UTC. So specify time zone in API call.&lt;/P&gt;&lt;P&gt;If you are using Splunk python SDK, then try "tz": "America/Chicago" as search parameter.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;By adding the tz parameter with your local time zone ("America/Chicago" for CST), you instruct Splunk to interpret earliest=-1d@d and latest=-0d@d relative to that timezone, making the API search behave identically to your UI search in terms of the time window. This should resolve the discrepancy in event counts&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prewin&lt;BR /&gt;Splunk Enthusiast | Always happy to help! If this answer helped you, please consider marking it as the solution or giving a kudos/Karma. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 04:10:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747317#M241799</guid>
      <dc:creator>PrewinThomas</dc:creator>
      <dc:date>2025-06-02T04:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: search results different between splunk UI/portal and splunk API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747350#M241802</link>
      <description>&lt;P&gt;Hi, any guidance on this..&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 14:50:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747350#M241802</guid>
      <dc:creator>Raj_Splunk_Ing</dc:creator>
      <dc:date>2025-06-02T14:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: search results different between splunk UI/portal and splunk API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747352#M241803</link>
      <description>&lt;P&gt;Hi, Thanks for your input&lt;BR /&gt;where do i add this... in my search query&lt;/P&gt;&lt;P&gt;this is how my URL looks like&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;https://server/services/search/jobs/export?search=search%20index%3Dcfs_apiconnect_102212%20%20%20%0Asourcetype%3D%22cfs_apigee_102212_st%22%20%20%0Aearliest%3D-1d%40d%20latest%3D%40d%20%0Aorganization%20IN%20(%22ccb-na%22%2C%22ccb-na-ext%22)%20%0AclientId%3D%22AMZ%22%20%0Astatus_code%3D200%0Aenvironment%3D%22XYZ-uat03%22%0A%7C%20table%20%20_time%2CclientId%2Corganization%2Cenvironment%2CproxyBasePath%2Capi_name&amp;amp;&amp;amp;output_mode=csv&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 15:48:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747352#M241803</guid>
      <dc:creator>Raj_Splunk_Ing</dc:creator>
      <dc:date>2025-06-02T15:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: search results different between splunk UI/portal and splunk API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747354#M241804</link>
      <description>&lt;P&gt;I noticed that i dont have splunk python SDK because in my python script i dont have import splunklib or import splunk.. i am using python script within the alteryx tool&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 16:01:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747354#M241804</guid>
      <dc:creator>Raj_Splunk_Ing</dc:creator>
      <dc:date>2025-06-02T16:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: search results different between splunk UI/portal and splunk API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747379#M241809</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/273058"&gt;@Raj_Splunk_Ing&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Modify Your Python Script in Alteryx:&lt;BR /&gt;You need to find the part of your Python script where you build the URL or the parameters for the HTTP request to Splunk. You will then add a tz parameter to that request, setting its value to the time zone string you found in your splunk ui timezone.&lt;/P&gt;&lt;P&gt;Eg:&lt;BR /&gt;params = {&lt;BR /&gt;'search': spl_query,&lt;BR /&gt;'output_mode': 'csv',&lt;BR /&gt;'tz': splunk_ui_timezone&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;url adding tz parameter&lt;/STRONG&gt;&lt;BR /&gt;&lt;A href="https://server/services/search/jobs/export?search=search%20index%3Dcfs_apiconnect_102212%20%20%20%0Asourcetype%3D%22cfs_apigee_102212_st%22%20%20%0Aearliest%3D-1d%40d%20latest%3D%40d%20%0Aorganization%20IN%20(%22ccb-na%22%2C%22ccb-na-ext%22)%20%0AclientId%3D%22AMZ%22%20%0Astatus_code%3D200%0Aenvironment%3D%22XYZ-uat03%22%0A%7C%20table%20%20_time%2CclientId%2Corganization%2Cenvironment%2CproxyBasePath%2Capi_name&amp;amp;" target="_blank"&gt;https://server/services/search/jobs/export?search=search%20index%3Dcfs_apiconnect_102212%20%20%20%0Asourcetype%3D%22cfs_apigee_102212_st%22%20%20%0Aearliest%3D-1d%40d%20latest%3D%40d%20%0Aorganization%20IN%20(%22ccb-na%22%2C%22ccb-na-ext%22)%20%0AclientId%3D%22AMZ%22%20%0Astatus_code%3D200%0Aenvironment%3D%22XYZ-uat03%22%0A%7C%20table%20%20_time%2CclientId%2Corganization%2Cenvironment%2CproxyBasePath%2Capi_name&amp;amp;&lt;/A&gt;&lt;STRONG&gt;tz=America%2FChicago&lt;/STRONG&gt;&amp;amp;output_mode=csv&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Prewin&lt;BR /&gt;Splunk Enthusiast | Always happy to help! If this answer helped you, please consider marking it as the solution or giving a kudos/Karma. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 04:50:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747379#M241809</guid>
      <dc:creator>PrewinThomas</dc:creator>
      <dc:date>2025-06-03T04:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: search results different between splunk UI/portal and splunk API</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747416#M241823</link>
      <description>&lt;P&gt;Hi tried to follow by adding this to the url at the end&lt;/P&gt;&lt;P&gt;%20tz=America%2FNew_York&amp;amp;output_mode=csv"&lt;/P&gt;&lt;P&gt;and in the headers&lt;/P&gt;&lt;P&gt;headers = {&lt;BR /&gt;'Authorization': 'Basic AuthKey','Content-Type':'text/csv','tz':'(GMT-04:00) Eastern Time (US &amp;amp; Canada)'&lt;BR /&gt;}&lt;BR /&gt;this is not returning anything&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 17:34:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-results-different-between-splunk-UI-portal-and-splunk-API/m-p/747416#M241823</guid>
      <dc:creator>Raj_Splunk_Ing</dc:creator>
      <dc:date>2025-06-03T17:34:16Z</dc:date>
    </item>
  </channel>
</rss>

