<?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: Twitted input.py HTTP Error 401(Unauthorized) in Security</title>
    <link>https://community.splunk.com/t5/Security/Twitted-input-py-HTTP-Error-401-Unauthorized/m-p/144939#M14587</link>
    <description>&lt;P&gt;This is easy to do with the REST API Modular Input.&lt;/P&gt;

&lt;P&gt;Download and untar to SPLUNK_HOME/etc/apps : &lt;A href="http://apps.splunk.com/app/1546/"&gt;http://apps.splunk.com/app/1546/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Then setup a stanza like the example below (for searching for tweets).&lt;/P&gt;

&lt;P&gt;Replace the oauth values with your own.&lt;/P&gt;

&lt;P&gt;Change the twitter query in the url_args to the tweets you want to search for.&lt;/P&gt;

&lt;P&gt;You can also add additional stanzas for other &lt;A href="https://dev.twitter.com/docs/api/1.1"&gt;Twitter REST API endpoints&lt;/A&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rest://My Tweets]
auth_type = oauth1
endpoint = &lt;A href="https://api.twitter.com/1.1/search/tweets.json" target="test_blank"&gt;https://api.twitter.com/1.1/search/tweets.json&lt;/A&gt;
http_method = GET
index = main
index_error_response_codes = 1
oauth1_access_token = XXXXXXXXXXXXX
oauth1_access_token_secret = XXXXXXXXXXXXX
oauth1_client_key = XXXXXXXXXXXXX
oauth1_client_secret = XXXXXXXXXXXXX
polling_interval = 30
response_handler = TwitterEventHandler
response_type = json
sourcetype = rest_twitter
streaming_request = 0
url_args = q=#splunk
disabled = 1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 16 Nov 2013 13:31:10 GMT</pubDate>
    <dc:creator>Damien_Dallimor</dc:creator>
    <dc:date>2013-11-16T13:31:10Z</dc:date>
    <item>
      <title>Twitted input.py HTTP Error 401(Unauthorized)</title>
      <link>https://community.splunk.com/t5/Security/Twitted-input-py-HTTP-Error-401-Unauthorized/m-p/144938#M14586</link>
      <description>&lt;P&gt;Hello Splunk community! I'm new to Splunk and I would like to be able to access and index data from my own Twitter account. It looks like the perfect example is the Twitted&amp;gt;input.py program. After taking a look at the README from the twitted folder, I successfully added the app to the Splunk web interface.&lt;/P&gt;

&lt;P&gt;When I run:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;python input.py
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm prompted my username and password. I entered my personal Twitter account credentials but I was hit with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Initializing Splunk ..
Listening (and sending data to localhost:9001)..
Error: There was an error logging in to Twitter:
HTTP Error 401 (Unauthorized)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I came across this forum post: &lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/74633/data-not-going-to-splunk"&gt;http://answers.splunk.com/answers/74633/data-not-going-to-splunk&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;but after checking my .splunkrc file and making sure my original input.py file was unedited, everything seems like it should work.&lt;/P&gt;

&lt;P&gt;Just for some additional info, I'm running Splunk enterprise 6.0, and using the python sdk 1.1. While I run this, I'm logged onto the Splunk web interface.&lt;/P&gt;

&lt;P&gt;If anyone can offer a few words of advice, I would greatly appreciate it!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2013 20:56:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Twitted-input-py-HTTP-Error-401-Unauthorized/m-p/144938#M14586</guid>
      <dc:creator>pwong591</dc:creator>
      <dc:date>2013-11-15T20:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Twitted input.py HTTP Error 401(Unauthorized)</title>
      <link>https://community.splunk.com/t5/Security/Twitted-input-py-HTTP-Error-401-Unauthorized/m-p/144939#M14587</link>
      <description>&lt;P&gt;This is easy to do with the REST API Modular Input.&lt;/P&gt;

&lt;P&gt;Download and untar to SPLUNK_HOME/etc/apps : &lt;A href="http://apps.splunk.com/app/1546/"&gt;http://apps.splunk.com/app/1546/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Then setup a stanza like the example below (for searching for tweets).&lt;/P&gt;

&lt;P&gt;Replace the oauth values with your own.&lt;/P&gt;

&lt;P&gt;Change the twitter query in the url_args to the tweets you want to search for.&lt;/P&gt;

&lt;P&gt;You can also add additional stanzas for other &lt;A href="https://dev.twitter.com/docs/api/1.1"&gt;Twitter REST API endpoints&lt;/A&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rest://My Tweets]
auth_type = oauth1
endpoint = &lt;A href="https://api.twitter.com/1.1/search/tweets.json" target="test_blank"&gt;https://api.twitter.com/1.1/search/tweets.json&lt;/A&gt;
http_method = GET
index = main
index_error_response_codes = 1
oauth1_access_token = XXXXXXXXXXXXX
oauth1_access_token_secret = XXXXXXXXXXXXX
oauth1_client_key = XXXXXXXXXXXXX
oauth1_client_secret = XXXXXXXXXXXXX
polling_interval = 30
response_handler = TwitterEventHandler
response_type = json
sourcetype = rest_twitter
streaming_request = 0
url_args = q=#splunk
disabled = 1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Nov 2013 13:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Twitted-input-py-HTTP-Error-401-Unauthorized/m-p/144939#M14587</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2013-11-16T13:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Twitted input.py HTTP Error 401(Unauthorized)</title>
      <link>https://community.splunk.com/t5/Security/Twitted-input-py-HTTP-Error-401-Unauthorized/m-p/144940#M14588</link>
      <description>&lt;P&gt;Thank you Damien for helping me find a solution to the problem. I'll work with the REST API from now on. &lt;/P&gt;

&lt;P&gt;Although, I still wonder what was wrong with the sample program/set up.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2013 22:41:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Twitted-input-py-HTTP-Error-401-Unauthorized/m-p/144940#M14588</guid>
      <dc:creator>pwong591</dc:creator>
      <dc:date>2013-11-16T22:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Twitted input.py HTTP Error 401(Unauthorized)</title>
      <link>https://community.splunk.com/t5/Security/Twitted-input-py-HTTP-Error-401-Unauthorized/m-p/144941#M14589</link>
      <description>&lt;P&gt;Probably because BASIC Auth is no longer supported for the streaming API : &lt;A href="https://dev.twitter.com/docs/streaming-apis/streams/public"&gt;https://dev.twitter.com/docs/streaming-apis/streams/public&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2013 03:39:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Twitted-input-py-HTTP-Error-401-Unauthorized/m-p/144941#M14589</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2013-11-17T03:39:02Z</dc:date>
    </item>
  </channel>
</rss>

