<?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: How to feed data/events into splunk remotely using splunk python APIs in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166602#M2221</link>
    <description>&lt;P&gt;I think using Splunk python SDK you can send the data to any Splunk instance&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.2/Search/ExportdatausingSDKs"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.2/Search/ExportdatausingSDKs&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Feb 2018 12:33:23 GMT</pubDate>
    <dc:creator>jangid</dc:creator>
    <dc:date>2018-02-05T12:33:23Z</dc:date>
    <item>
      <title>How to feed data/events into splunk remotely using splunk python APIs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166592#M2211</link>
      <description>&lt;P&gt;I'm new to Splunk, and I need to feed some logging message/events into Splunk remotely using Splunk Python APIs.&lt;BR /&gt;
This is a new platform using Linux, so there won't be any existing APP to use.&lt;BR /&gt;&lt;BR /&gt;
The message/events look like the following:&lt;BR /&gt;
   INFO 2014-12-29 20:37:54,611 get_customer_type 3010 get_customer type....&lt;BR /&gt;
   INFO 2014-12-29 20:37:54,652 get_customer_id 2996 get_customer_id....&lt;BR /&gt;
   ERROR 2014-12-30 00:05:25,558 save_cloudx_config 52 lookup bucket:cheng-bucket1 failed&lt;/P&gt;

&lt;P&gt;I have launched a Splunck at a remote linux machine to collect data, and, from my platform, I would like to progarmatically&lt;BR /&gt;
call Splunk Python APIs to connect to this remote Splunk, do some configuration, and be able to start calling whatever.submit&lt;BR /&gt;
to Splunk so that Splunk can index the event/messages I submitted and be able to perform searching for those data.&lt;BR /&gt;
I have already confirmed that I can access the remote Splunk using the following:&lt;BR /&gt;
      service = client.connect(host='10.88.0.99',port=8000,username='admin',password='123456')&lt;BR /&gt;
My qustions are:&lt;BR /&gt;
 1. Is there any examples&lt;BR /&gt;
 2. What are the basic essential python APIsI need to call to do the essential configuration to start feeding event to Splunk?  e.g. do I need to create a new index?&lt;BR /&gt;
 3. Is there any universal APP that can be used for this purpose?&lt;/P&gt;

&lt;P&gt;I am new to Splunk and please forget me if I ask stupid questions.&lt;BR /&gt;
Thanks a lot...&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:31:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166592#M2211</guid>
      <dc:creator>cchsiang2002</dc:creator>
      <dc:date>2020-09-28T18:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed data/events into splunk remotely using splunk python APIs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166593#M2212</link>
      <description>&lt;P&gt;The Splunk API is used to manage Splunk and run searches, but not to submit data.  There are far easier ways to do that.&lt;/P&gt;

&lt;P&gt;Perhaps the easiest is to install the Splunk Universal Forwarder on your local Linux box (the one generating the logs).  Tell the forwarder where the logs are and it will send them to Splunk for indexing.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Dec 2014 18:42:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166593#M2212</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-12-31T18:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed data/events into splunk remotely using splunk python APIs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166594#M2213</link>
      <description>&lt;P&gt;Thanks Rich..  Is there any document that I can read for step-by-step instructions to to install the Splunk Universal Forwarder and make it work?&lt;/P&gt;</description>
      <pubDate>Wed, 31 Dec 2014 19:10:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166594#M2213</guid>
      <dc:creator>cchsiang2002</dc:creator>
      <dc:date>2014-12-31T19:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed data/events into splunk remotely using splunk python APIs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166595#M2214</link>
      <description>&lt;P&gt;Start with &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Introducingtheuniversalforwarder"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Introducingtheuniversalforwarder&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Dec 2014 19:11:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166595#M2214</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-12-31T19:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed data/events into splunk remotely using splunk python APIs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166596#M2215</link>
      <description>&lt;P&gt;I briefly glanced through the document.  Here is how I understood.. Please correct me if I am wrong&lt;BR /&gt;
 1. download Splunk forwarder to my own machine.&lt;BR /&gt;
 2. modify inputs.conf  and specify which file to monitor, &lt;BR /&gt;
      e.g. [monitor://etc/localgateway/command.log]&lt;BR /&gt;
      With this, when a new message is added to this file, splunk forwarder will send it out.&lt;BR /&gt;
     But which one to use?  There are three of them...&lt;BR /&gt;
    ./splunkforwarder/etc/system/default/inputs.conf&lt;BR /&gt;
   ./splunkforwarder/etc/apps/introspection_generator_addon/default/inputs.conf&lt;BR /&gt;
   ./splunkforwarder/etc/apps/SplunkUniversalForwarder/default/inputs.conf&lt;BR /&gt;
 3. modify outputs.conf to specify where to send the new message/log collected.&lt;BR /&gt;
     e.g. [tcpout:group1]&lt;BR /&gt;
             server=10.1.1.197:9997&lt;BR /&gt;&lt;BR /&gt;
 5. Restart Splunk&lt;/P&gt;

&lt;P&gt;Questiions:&lt;BR /&gt;
 1. which inputs.conf to modify?  There are multiple of them.&lt;BR /&gt;
 2. For outputs.conf, what port number to use?  Do I need to configure something in Splunk Enterprise server to listen to that port?  What is the corresponding config on Splunk Enterprise server?&lt;BR /&gt;
 3. For inputs.conf,  [monitor://etc/localgateway/command.log] will monitor this command.log file, and send newly added event to Splunk server.  Can I do filtering, and only send certain message?   Or my backend software can filter the message myself, and only put the necessary messages into a new file, and have the forwarder only monitor this new file so that I can control which event/line/message to send.&lt;BR /&gt;
This is a lot of questions to ask,  I really appreciate your helps.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:33:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166596#M2215</guid>
      <dc:creator>cchsiang2002</dc:creator>
      <dc:date>2020-09-28T18:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed data/events into splunk remotely using splunk python APIs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166597#M2216</link>
      <description>&lt;P&gt;I have added the following on my log-holding Linux machine:&lt;/P&gt;

&lt;P&gt;[monitor:/etc/localgateway/commandlog.log]&lt;BR /&gt;
sourcetype=iis&lt;BR /&gt;
_tzhint=GMT&lt;BR /&gt;
_TCP_ROUTING = *&lt;BR /&gt;
index = _internal&lt;/P&gt;

&lt;P&gt;[tcpout]&lt;BR /&gt;
indexAndForward=true&lt;BR /&gt;
[tcpout:indexer1]&lt;BR /&gt;
server=10.88.0.99:9997&lt;BR /&gt;
forwardedindex.0.whitelist = .*&lt;BR /&gt;
forwardedindex.1.blacklist = _.*&lt;BR /&gt;
forwardedindex.2.whitelist = (_audit|_introspection)&lt;BR /&gt;
forwardedindex.filter.disable = false&lt;/P&gt;

&lt;P&gt;On the Splunk Enterprise Server, I have added "Setting-&amp;gt;Forwarding &amp;amp; Receiving-&amp;gt;Configure Receiveing-&amp;gt;add New&lt;BR /&gt;
for port 9997.&lt;/P&gt;

&lt;P&gt;I have checked the /opt/splunkforwarder/var/log/splunk/splunkd.log and I got:&lt;BR /&gt;
12-31-2014 21:44:35.210 -0800 INFO  TcpOutputProc - Initializing connection for non-ssl forwarding to 10.88.0.99:9997&lt;BR /&gt;
12-31-2014 21:44:35.210 -0800 INFO  TcpOutputProc - tcpout group indexer1 using Auto load balanced forwarding&lt;BR /&gt;
12-31-2014 21:44:35.305 -0800 INFO  TailingProcessor - Parsing configuration stanza: monitor:/etc/localgateway/commandlog.log.&lt;BR /&gt;
12-31-2014 21:44:35.305 -0800 INFO  TailingProcessor - Adding watch on path: /etc/localgateway/commandlog.log.&lt;BR /&gt;
12-31-2014 21:44:35.313 -0800 INFO  TcpOutputProc - Connected to idx=10.88.0.99:9997&lt;BR /&gt;
12-31-2014 21:44:35.317 -0800 INFO  WatchedFile - Will begin reading at offset=476993 for file='/opt/splunkforwarder/var/log/splunk/metrics.log'.&lt;/P&gt;

&lt;P&gt;But I don't see "WatchedFile - Will begin reading at offset......for /etc/localgateway/commandlog.log".&lt;BR /&gt;
On Splunk Enterprise, I don't see any log when I do "Search &amp;amp; Reporting-&amp;gt;Data Summary".&lt;BR /&gt;
Any Idea?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:31:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166597#M2216</guid>
      <dc:creator>cchsiang2002</dc:creator>
      <dc:date>2020-09-28T18:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed data/events into splunk remotely using splunk python APIs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166598#M2217</link>
      <description>&lt;P&gt;The files to modify are $SPLUNK_HOME/etc/system/local/inputs.conf and $SPLUNK_HOME/etc/system/local/outputs.conf.  Create them if necessary.&lt;BR /&gt;&lt;BR /&gt;
Do NOT use indexes that begin with _ - they are for Splunk to use.&lt;BR /&gt;
The indexAndForward attribute does not apply to universal forwarders.&lt;BR /&gt;
Universal forwarders do not filter - do that in the indexer.&lt;BR /&gt;
You don't need the _TCP_ROUTING attribute.&lt;BR /&gt;
Try to keep things simple.  Once you have data being indexed you can try to add controls.&lt;BR /&gt;
You may need to specify the log file as &lt;CODE&gt;monitor:///etc/localgateway/commandlog.log&lt;/CODE&gt;.&lt;BR /&gt;
Verify you have your settings in the right files and restart the forwarder.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:31:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166598#M2217</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-09-28T18:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed data/events into splunk remotely using splunk python APIs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166599#M2218</link>
      <description>&lt;P&gt;I have done what you said, and things are better, but still no data in Splunk Server.&lt;BR /&gt;
I do see this in splunkd.log:&lt;BR /&gt;
01-01-2015 09:12:31.451 -0800 INFO  TailingProcessor - Parsing configuration stanza: monitor:///etc/localgateway/commandlog.log.&lt;BR /&gt;
01-01-2015 09:12:31.451 -0800 INFO  TailingProcessor - Adding watch on path: /etc/localgateway/commandlog.log.&lt;/P&gt;

&lt;P&gt;01-01-2015 09:12:31.495 -0800 WARN  DateParserVerbose - Failed to parse timestamp. Defaulting to timestamp of previous event (Wed Dec 31 21:51:21 2014). Context: FileClassifier /etc/localgateway/commandlog.log&lt;/P&gt;

&lt;P&gt;01-01-2015 09:12:31.674 -0800 INFO  TcpOutputProc - Connected to idx=10.88.0.99:9997&lt;BR /&gt;
01-01-2015 09:13:01.184 -0800 WARN  AuthenticationManagerSplunk - Seed file is not present. Defaulting to generic username/pass pair.&lt;/P&gt;

&lt;H1&gt;My outputs_conf:&lt;/H1&gt;

&lt;H1&gt;Version 6.2.1&lt;/H1&gt;

&lt;P&gt;[tcpout]&lt;BR /&gt;
[tcpout:cloudn]&lt;BR /&gt;
server=10.88.0.99:9997&lt;/P&gt;

&lt;H1&gt;My inputs.conf:&lt;/H1&gt;

&lt;P&gt;[splunktcp]&lt;BR /&gt;
route=has_key:tautology:parsingQueue;absent_key:tautology:parsingQueue&lt;BR /&gt;
[monitor:///etc/localgateway/commandlog.log]&lt;BR /&gt;
index = _internal&lt;BR /&gt;
[monitor://$SPLUNK_HOME/var/log/splunk/splunkd.log]&lt;BR /&gt;
_TCP_ROUTING = *&lt;BR /&gt;
index = _internal&lt;/P&gt;

&lt;P&gt;[monitor://$SPLUNK_HOME/var/log/splunk/metrics.log]&lt;BR /&gt;
_TCP_ROUTING = *&lt;BR /&gt;
index = _internal&lt;/P&gt;

&lt;P&gt;Any Idea...  I really appreciate your helps. Thanks a lot..&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:33:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166599#M2218</guid>
      <dc:creator>cchsiang2002</dc:creator>
      <dc:date>2020-09-28T18:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed data/events into splunk remotely using splunk python APIs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166600#M2219</link>
      <description>&lt;P&gt;It's still a bad idea to put data into _internal.&lt;BR /&gt;
See &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/admin/User-seedconf"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.1/admin/User-seedconf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jan 2015 22:17:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166600#M2219</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-01-01T22:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed data/events into splunk remotely using splunk python APIs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166601#M2220</link>
      <description>&lt;P&gt;Hi Rich,&lt;BR /&gt;
Thanks a lot.   Finally I can see the log on my Splunk Enterprise Server.&lt;BR /&gt;
I simply deleted all other lines in the inputs and outputs.conf, and I only have:&lt;/P&gt;

&lt;H1&gt;For outputs.conf:&lt;/H1&gt;

&lt;P&gt;[tcpout]&lt;BR /&gt;
[tcpout:cloudn]&lt;BR /&gt;
server=10.88.0.99:9997&lt;/P&gt;

&lt;H1&gt;For inputs.conf:&lt;/H1&gt;

&lt;P&gt;[monitor:///etc/localgateway/commandlog.log]&lt;/P&gt;

&lt;P&gt;This seems to do the magic.  Thank you for the advice.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jan 2015 17:23:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166601#M2220</guid>
      <dc:creator>cchsiang2002</dc:creator>
      <dc:date>2015-01-02T17:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed data/events into splunk remotely using splunk python APIs</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166602#M2221</link>
      <description>&lt;P&gt;I think using Splunk python SDK you can send the data to any Splunk instance&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.2/Search/ExportdatausingSDKs"&gt;https://docs.splunk.com/Documentation/Splunk/7.0.2/Search/ExportdatausingSDKs&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 12:33:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-feed-data-events-into-splunk-remotely-using-splunk-python/m-p/166602#M2221</guid>
      <dc:creator>jangid</dc:creator>
      <dc:date>2018-02-05T12:33:23Z</dc:date>
    </item>
  </channel>
</rss>

