<?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: splunklib sourcetype in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/splunklib-sourcetype/m-p/299925#M3853</link>
    <description>&lt;P&gt;I think I found this, as the following works...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rr = results.ResultsReader(service.jobs.export("search host=\"cmhlpecomweb*\" sourcetype=access_combined GET /catalog/actions/giftcard-balance-submit.jsp", 
                                               **{"earliest_time":"2016-12-31T23:57:00.000-05:00",
                                                  "latest_time":"2017-01-01T00:00:00.000-05:00"}))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think a more complete example should be in the docs for this, rather than &lt;CODE&gt;search * | head 5&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Regardless, it works, so thanks to anyone that gave this some thought.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Feb 2017 15:25:35 GMT</pubDate>
    <dc:creator>stevedhoward</dc:creator>
    <dc:date>2017-02-15T15:25:35Z</dc:date>
    <item>
      <title>splunklib sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/splunklib-sourcetype/m-p/299923#M3851</link>
      <description>&lt;P&gt;In the splunk UI, I can have a query such as the following...&lt;/P&gt;

&lt;P&gt;host="cmhlpecomweb*" sourcetype=access_combined "GET /check-out/actions/gift-card-submit.jsp" &lt;/P&gt;

&lt;P&gt;I have been unable to find how to do this through the splunklib python client.&lt;/P&gt;

&lt;P&gt;I have tried numerous combinations, and can find no referecne to how to do this in the Splunk documention.&lt;/P&gt;

&lt;P&gt;Examples of what has been tried&lt;/P&gt;

&lt;P&gt;service.jobs.export("host=cmhlpecomweb* sourcetype=access_combined | search GET /check-out/actions/gift-card-submit.jsp", &lt;BR /&gt;
                                **{"earliest_time":"2017-02-13T10:00:00.000-07:00"}))&lt;/P&gt;

&lt;P&gt;service.jobs.export("regex field= host=cmhlpecomweb* sourcetype=access_combined | search GET /check-out/actions/gift-card-submit.jsp", &lt;BR /&gt;
                                **{"earliest_time":"2017-02-13T10:00:00.000-07:00"}))&lt;/P&gt;

&lt;P&gt;service.jobs.export("search GET /check-out/actions/gift-card-submit.jsp | host=cmhlpecomweb*  sourcetype=access_combined ", &lt;BR /&gt;
                                **{"earliest_time":"2017-02-13T10:00:00.000-07:00"}))&lt;/P&gt;

&lt;P&gt;service.jobs.export("search GET /check-out/actions/gift-card-submit.jsp host=cmhlpecomweb*  sourcetype=access_combined ", &lt;BR /&gt;
                                **{"earliest_time":"2017-02-13T10:00:00.000-07:00"}))&lt;/P&gt;

&lt;P&gt;Surely this can't be this difficult, but after spending the better part of an afternoon, I give up.  Is this documented, or even possible?   If documented, a pointer to that info would be great!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:52:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/splunklib-sourcetype/m-p/299923#M3851</guid>
      <dc:creator>stevedhoward</dc:creator>
      <dc:date>2020-09-29T12:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: splunklib sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/splunklib-sourcetype/m-p/299924#M3852</link>
      <description>&lt;P&gt;Are you using the results reader?&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.5.1612/Search/ExportdatausingSDKs"&gt;http://docs.splunk.com/Documentation/SplunkCloud/6.5.1612/Search/ExportdatausingSDKs&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;import splunklib.client as client&lt;BR /&gt;
import splunklib.results as results&lt;BR /&gt;
service = client.connect(…)&lt;BR /&gt;
rr = results.ResultsReader(service.jobs.export("search index=_internal earliest=-1h | head &lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/splunklib-sourcetype/m-p/299924#M3852</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-02-15T15:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: splunklib sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/splunklib-sourcetype/m-p/299925#M3853</link>
      <description>&lt;P&gt;I think I found this, as the following works...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rr = results.ResultsReader(service.jobs.export("search host=\"cmhlpecomweb*\" sourcetype=access_combined GET /catalog/actions/giftcard-balance-submit.jsp", 
                                               **{"earliest_time":"2016-12-31T23:57:00.000-05:00",
                                                  "latest_time":"2017-01-01T00:00:00.000-05:00"}))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think a more complete example should be in the docs for this, rather than &lt;CODE&gt;search * | head 5&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Regardless, it works, so thanks to anyone that gave this some thought.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:25:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/splunklib-sourcetype/m-p/299925#M3853</guid>
      <dc:creator>stevedhoward</dc:creator>
      <dc:date>2017-02-15T15:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: splunklib sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/splunklib-sourcetype/m-p/299926#M3854</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am, but the syntax I had above consistently threw exceptions.  I have since found that I can simply prefix the same search string with "search" (go figure :)), and escape the double quotations for host.  After that, it works.&lt;/P&gt;

&lt;P&gt;I will wait to verify I am not still missing anything, and then accept your answer.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:31:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/splunklib-sourcetype/m-p/299926#M3854</guid>
      <dc:creator>stevedhoward</dc:creator>
      <dc:date>2017-02-15T15:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: splunklib sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/splunklib-sourcetype/m-p/299927#M3855</link>
      <description>&lt;P&gt;you can escape your quotes if you need them just add a \ before them ... \" should work... maybe \"&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 16:29:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/splunklib-sourcetype/m-p/299927#M3855</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-02-15T16:29:45Z</dc:date>
    </item>
  </channel>
</rss>

