Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 7 commits
  • 49 files changed
  • 0 comments
  • 1 contributor

Showing 49 changed files with 503 additions and 397 deletions. Show diff stats Hide diff stats

  1. 25  .gitignore
  2. 25  .tar_exclude
  3. 9  .travis.yml
  4. 18  Cheffile
  5. 16  Cheffile.lock
  6. 25  LICENSE
  7. 70  Makefile
  8. 18  README.md
  9. 31  Vagrantfile
  10. 48  appserver/event_renderers/tweets_with_image.html
  11. 0  {twitter2 → }/appserver/static/appIcon.png
  12. 0  {twitter2 → }/appserver/static/appLogo_white_splunkpowered.png
  13. 5  {twitter2 → }/appserver/static/application.css
  14. 0  {twitter2 → }/appserver/static/screenshot-full.png
  15. 0  {twitter2 → }/appserver/static/screenshot.png
  16. 0  {twitter2 → }/bin/http_stream.py
  17. 0  {twitter2 → }/bin/splunklib/__init__.py
  18. 0  {twitter2 → }/bin/splunklib/binding.py
  19. 0  {twitter2 → }/bin/splunklib/client.py
  20. 0  {twitter2 → }/bin/splunklib/data.py
  21. 0  {twitter2 → }/bin/splunklib/results.py
  22. 2  twitter2/bin/twitter_stream.py → bin/twix_stream.py
  23. 0  twitter2/bin/twitter_verify_password.py → bin/twix_verify_password.py
  24. 26  default/app.conf
  25. 15  default/data/ui/nav/default.xml
  26. 14  default/data/ui/views/instagram.xml
  27. 14  default/data/ui/views/sandy.xml
  28. 8  twitter2/default/data/ui/views/twitter_drilldown.xml → default/data/ui/views/twix_drilldown.xml
  29. 8  twitter2/default/data/ui/views/twitter_general.xml → default/data/ui/views/twix_general.xml
  30. 13  default/event_renderers.conf
  31. 11  default/eventtypes.conf
  32. 12  default/indexes.conf
  33. 15  default/inputs.conf
  34. 17  default/props.conf
  35. 40  default/savedsearches.conf
  36. 14  {twitter2 → }/default/setup.xml
  37. 16  requirements.txt
  38. 7  roles/twix.rb
  39. 7  setup.cfg
  40. 0  tests/__init__.py
  41. 9  tests/test_template.py
  42. 21  twitter2/default/app.conf
  43. 9  twitter2/default/data/ui/nav/default.xml
  44. 4  twitter2/default/indexes.conf
  45. 7  twitter2/default/inputs.conf
  46. 9  twitter2/default/props.conf
  47. 105  twitter2/default/savedsearches.conf
  48. 202  twitter2/default/viewstates.conf
  49. 5  twix.gems
25  .gitignore
... ...
@@ -1,5 +1,22 @@
1  
-# Python
2  
-*.py[co]
3  
-
4  
-# OS X
  1
+metadata/
  2
+local/
  3
+*.spl
  4
+*.deb
  5
+*.vagrant
  6
+.idea
5 7
 .DS_Store
  8
+local_*
  9
+*.py[oc]
  10
+*.egg/
  11
+*.egg-info/
  12
+build/
  13
+dist/
  14
+RELEASE-VERSION.txt
  15
+cover/
  16
+nosetests.xml
  17
+output.xml
  18
+.coverage
  19
+pylint.log
  20
+flake8.log
  21
+tmp/
  22
+t/
25  .tar_exclude
... ...
@@ -0,0 +1,25 @@
  1
+.git*
  2
+local
  3
+metadata/local.meta
  4
+*.tar
  5
+*.gz
  6
+*.spl
  7
+*.deb
  8
+.vagrant
  9
+.tar_exclude
  10
+cookbooks
  11
+site-cookbooks
  12
+tmp
  13
+roles
  14
+Cheffile*
  15
+Makefile
  16
+Vagrantfile
  17
+*.log
  18
+tests
  19
+setup.cfg
  20
+cover
  21
+t
  22
+*.gems
  23
+requirements.txt
  24
+.travis.yml
  25
+docs
9  .travis.yml
... ...
@@ -0,0 +1,9 @@
  1
+language: python
  2
+
  3
+python:
  4
+  - "2.6"
  5
+  - "2.7"
  6
+
  7
+install: make
  8
+
  9
+script: make test
18  Cheffile
... ...
@@ -0,0 +1,18 @@
  1
+#!/usr/bin/env ruby
  2
+# Libarian configuration file for __happen__.
  3
+#
  4
+# Author:: Greg Albrecht <gba@splunk.com>
  5
+# Copyright:: Copyright 2012 Splunk, Inc.
  6
+# License:: Apache License 2.0
  7
+#
  8
+
  9
+
  10
+site 'http://community.opscode.com/api/v1'
  11
+
  12
+cookbook 'apt'
  13
+
  14
+path 'cookbooks'
  15
+
  16
+cookbook 'splunk',
  17
+  :git => 'https://github.com/ampledata/cookbook-splunk.git',
  18
+  :ref => 'develop'
16  Cheffile.lock
... ...
@@ -0,0 +1,16 @@
  1
+SITE
  2
+  remote: http://community.opscode.com/api/v1
  3
+  specs:
  4
+    apt (1.8.4)
  5
+
  6
+GIT
  7
+  remote: https://github.com/ampledata/cookbook-splunk.git
  8
+  ref: develop
  9
+  sha: a1fb00605873ab5717125efc169865f86e3c1480
  10
+  specs:
  11
+    splunk (0.0.3)
  12
+
  13
+DEPENDENCIES
  14
+  apt (>= 0)
  15
+  splunk (>= 0)
  16
+
25  LICENSE
@@ -175,28 +175,3 @@
175 175
       of your accepting any such warranty or additional liability.
176 176
 
177 177
    END OF TERMS AND CONDITIONS
178  
-
179  
-   APPENDIX: How to apply the Apache License to your work.
180  
-
181  
-      To apply the Apache License to your work, attach the following
182  
-      boilerplate notice, with the fields enclosed by brackets "[]"
183  
-      replaced with your own identifying information. (Don't include
184  
-      the brackets!)  The text should be enclosed in the appropriate
185  
-      comment syntax for the file format. We also recommend that a
186  
-      file or class name and description of purpose be included on the
187  
-      same "printed page" as the copyright notice for easier
188  
-      identification within third-party archives.
189  
-
190  
-   Copyright [yyyy] [name of copyright owner]
191  
-
192  
-   Licensed under the Apache License, Version 2.0 (the "License");
193  
-   you may not use this file except in compliance with the License.
194  
-   You may obtain a copy of the License at
195  
-
196  
-       http://www.apache.org/licenses/LICENSE-2.0
197  
-
198  
-   Unless required by applicable law or agreed to in writing, software
199  
-   distributed under the License is distributed on an "AS IS" BASIS,
200  
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201  
-   See the License for the specific language governing permissions and
202  
-   limitations under the License.
70  Makefile
... ...
@@ -0,0 +1,70 @@
  1
+# Makefile for twix.
  2
+#
  3
+# Source:: https://github.com/ampledata/twix
  4
+# Author:: Greg Albrecht <mailto:gba@gregalbrecht.com>
  5
+# Copyright:: Copyright 2012 Greg Albrecht
  6
+# License:: Apache License 2.0
  7
+#
  8
+
  9
+
  10
+
  11
+.DEFAULT_GOAL := all
  12
+
  13
+all: install_requirements install_gemset librarian_update
  14
+
  15
+install_requirements:
  16
+	pip install -r requirements.txt --use-mirrors
  17
+
  18
+build: clean
  19
+	cd ..; tar -X twix/.tar_exclude -zcpf twix/twix.spl twix
  20
+
  21
+vagrant_up:
  22
+	vagrant up
  23
+
  24
+vagrant: vagrant_up
  25
+
  26
+lint:
  27
+	pylint -f parseable -i y -r y bin/*.py tests/*.py | tee pylint.log
  28
+
  29
+flake8:
  30
+	flake8 --exit-zero  --max-complexity 12 bin/*.py tests/*.py | \
  31
+		awk -F\: '{printf "%s:%s: [E]%s\n", $$1, $$2, $$3}' | tee flake8.log
  32
+
  33
+pep8: flake8
  34
+
  35
+clonedigger:
  36
+	clonedigger --cpd-output .
  37
+
  38
+nosetests:
  39
+	nosetests
  40
+
  41
+test: all lint flake8 clonedigger nosetests
  42
+
  43
+install:
  44
+	vagrant ssh -c 'sudo /opt/splunk/bin/splunk install app /vagrant/twix.spl -update true -auth admin:changeme'
  45
+	vagrant ssh -c 'sudo /opt/splunk/bin/splunk restart'
  46
+
  47
+add_input:
  48
+	vagrant ssh -c 'sudo /opt/splunk/bin/splunk add monitor /var/log -auth admin:changeme'
  49
+
  50
+generate_events:
  51
+	vagrant ssh -c 'logger -t generated ERROR'
  52
+
  53
+clean:
  54
+	rm -rf *.egg* build dist *.pyc *.pyo cover doctest_pypi.cfg nosetests.xml \
  55
+		pylint.log *.egg output.xml flake8.log output.xml */*.pyc .coverage *.spl
  56
+
  57
+
  58
+install_gemset:
  59
+	rvm gemset import twix.gems
  60
+
  61
+librarian_update:
  62
+	librarian-chef update
  63
+
  64
+vagrant_provision:
  65
+	vagrant provision
  66
+
  67
+vagrant_destroy:
  68
+	vagrant destroy -f
  69
+
  70
+nuke: vagrant_destroy clean all vagrant_up build install add_input
18  README.md
Source Rendered
... ...
@@ -1,19 +1,15 @@
1  
-# Splunk-Twitter Connector
  1
+# twix - Twitter Pix
2 2
 
3 3
 This app provides a scripted input for [Splunk](http://www.splunk.com/) that
4 4
 automatically extracts tweets from [Twitter](https://twitter.com/)'s [1% sample
5  
-stream](https://dev.twitter.com/docs/api/1/get/statuses/sample). It is tested on
6  
-Splunk 4.3.2.
  5
+stream](https://dev.twitter.com/docs/api/1/get/statuses/sample).
7 6
 
8 7
 A number of dashboards and searches are also included to demonstrate how Splunk
9 8
 can be used to visualize Twitter activity.
10 9
 
11 10
 ## Installation
12 11
 
13  
-* Install the app by copying the `twitter` directory to
14  
-  `$SPLUNK_HOME/etc/apps/twitter`.
15  
-
16  
-* (Re)start Splunk so that the app is recognized.
  12
+# Install from Splunk Base
17 13
 
18 14
 * In the Splunk web interface, from the App menu, select the Twitter app. And
19 15
   press "Continue to app setup page".
@@ -54,3 +50,11 @@ Displays the locations of tweets on a map.
54 50
 
55 51
 This software is licensed under the Apache License 2.0. Details can be found in
56 52
 the file LICENSE.
  53
+
  54
+## Author
  55
+
  56
+Greg Albrecht <mailto:gba@splunk.com>
  57
+
  58
+## Source
  59
+
  60
+https://github.com/ampledata/twix
31  Vagrantfile
... ...
@@ -0,0 +1,31 @@
  1
+# Vagrantfile for twix
  2
+#
  3
+# -*- mode: ruby -*-
  4
+# vi: set ft=ruby :
  5
+#
  6
+# Author:: Greg Albrecht <mailto:gba@gregalbrecht.com>
  7
+# Copyright:: Copyright 2012 Greg Albrecht
  8
+# License:: Apache License 2.0
  9
+#
  10
+
  11
+
  12
+Vagrant::Config.run do |config|
  13
+  config.vm.box = 'stormbase_200'
  14
+  config.vm.box_url = 'https://dl.dropbox.com/u/4036736/stormbase_200.box'
  15
+  config.vm.host_name = 'pagerduty'
  16
+  config.vm.forward_port 8000, 4170
  17
+  config.vm.forward_port 8089, 4179
  18
+  config.vm.provision :chef_solo do |chef|
  19
+    chef.cookbooks_path = ['cookbooks']
  20
+    chef.roles_path = 'roles'
  21
+    chef.add_role('twix')
  22
+    chef.json = {
  23
+      'splunk' => {
  24
+        'server' => {
  25
+          'package' => 'splunk-5.0.1-143156-linux-2.6-amd64.deb',
  26
+          'download_url' => 'http://download.splunk.com/releases/5.0.1/splunk/linux/splunk-5.0.1-143156-linux-2.6-amd64.deb'
  27
+        }
  28
+      }
  29
+    }
  30
+  end
  31
+end
48  appserver/event_renderers/tweets_with_image.html
... ...
@@ -0,0 +1,48 @@
  1
+<!--
  2
+Event Renderer for tweets_with_image from twix.
  3
+
  4
+Source:: https://github.com/ampledata/tiwx
  5
+Author:: Greg Albrecht <gba@gregalbrecht.com>
  6
+Copyright:: Copyright 2012 Greg Albrecht
  7
+License:: Apache License 2.0
  8
+-->
  9
+
  10
+
  11
+<%page args="job, event, request, options" />
  12
+
  13
+<%def name="get_img_url(event)">
  14
+    <%
  15
+    return event.fields.get('image_url')
  16
+    %>
  17
+</%def>
  18
+
  19
+<%def name="get_thumb(img_url)">
  20
+    <% 
  21
+    thumb = str(img_url)
  22
+
  23
+    if 'twitpic' in img_url:
  24
+        thumb = 'http://twitpic.com/show/thumb/%s' % img_url.split('/')[-1]
  25
+    elif 'tweetphoto' in img_url:
  26
+        thumb = 'http://TweetPhotoAPI.com/api/TPAPI.svc/imagefromurl?size=thumbnail&url=%s' % img_url
  27
+    elif 'pikchur' in img_url or img_url.startswith('pk.gd/'):
  28
+        thumb = 'http://img.pikchur.com/pic_%s_t.jpg' % img_url.split('/')[-1]
  29
+    elif 'yfrog' in img_url and img_url.endswith('j'):
  30
+        thumb = img_url + '.th.jpg'
  31
+    elif 'instagr' in img_url:
  32
+        if '/' in thumb[:-1]:
  33
+            join_char = ''
  34
+        else:
  35
+            join_char = '/'
  36
+        thumb = img_url + join_char + 'media/?size=m'
  37
+
  38
+    if not 'http' in thumb:
  39
+        thumb = ''.join(['http://', thumb])
  40
+
  41
+    return thumb
  42
+    %>
  43
+</%def>
  44
+
  45
+<% image_url = get_img_url(event) %>
  46
+% if image_url is not None:
  47
+    <a border=0 href="${str(image_url)}"><img src="${get_thumb(str(image_url))}"></a>
  48
+% endif
0  twitter2/appserver/static/appIcon.png → appserver/static/appIcon.png
File renamed without changes
0  .../appserver/static/appLogo_white_splunkpowered.png → appserver/static/appLogo_white_splunkpowered.png
File renamed without changes
5  twitter2/appserver/static/application.css → appserver/static/application.css
@@ -4,3 +4,8 @@
4 4
     background-image: url(appLogo_white_splunkpowered.png);
5 5
     background-repeat: no-repeat;
6 6
 }
  7
+
  8
+.EventsViewer .splEvent-tweets_with_image {
  9
+  clear: none;
  10
+  float: left;
  11
+}
0  twitter2/appserver/static/screenshot-full.png → appserver/static/screenshot-full.png
File renamed without changes
0  twitter2/appserver/static/screenshot.png → appserver/static/screenshot.png
File renamed without changes
0  twitter2/bin/http_stream.py → bin/http_stream.py
File renamed without changes
0  twitter2/bin/splunklib/__init__.py → bin/splunklib/__init__.py
File renamed without changes
0  twitter2/bin/splunklib/binding.py → bin/splunklib/binding.py
File renamed without changes
0  twitter2/bin/splunklib/client.py → bin/splunklib/client.py
File renamed without changes
0  twitter2/bin/splunklib/data.py → bin/splunklib/data.py
File renamed without changes
0  twitter2/bin/splunklib/results.py → bin/splunklib/results.py
File renamed without changes
2  twitter2/bin/twitter_stream.py → bin/twix_stream.py
@@ -90,7 +90,7 @@ def get_credentials(session_key):
90 90
         port=splunk.getDefault('port'),
91 91
         scheme=splunk.getDefault('protocol'),
92 92
         owner='nobody',
93  
-        app='twitter2',
  93
+        app='twix',
94 94
         token='Splunk %s' % session_key)
95 95
     
96 96
     # Return first set of credentials
0  twitter2/bin/twitter_verify_password.py → bin/twix_verify_password.py
File renamed without changes
26  default/app.conf
... ...
@@ -0,0 +1,26 @@
  1
+# Splunk app configuration for twix.
  2
+#
  3
+# Source:: https://github.com/ampledata/twix
  4
+# Author:: Greg Albrecht <gba@gregalbrecht.com>
  5
+# Copyright:: Copyright 2012 Greg Albrecht
  6
+# License:: Apache License 2.0
  7
+#
  8
+
  9
+
  10
+[install]
  11
+is_configured = 0
  12
+
  13
+[ui]
  14
+is_visible = 1
  15
+label = twix
  16
+
  17
+[launcher]
  18
+author = Greg Albrecht
  19
+description = Image viewer for Twitter's sample stream.
  20
+version = 1.0.0
  21
+
  22
+[credentials_settings]
  23
+verify_script = "$SPLUNK_HOME/bin/python" "$SPLUNK_HOME/etc/apps/twix/bin/twix_verify_password.py"
  24
+
  25
+[package]
  26
+id = twix
15  default/data/ui/nav/default.xml
... ...
@@ -0,0 +1,15 @@
  1
+<!--
  2
+Source:: https://github.com/ampledata/twix
  3
+Author:: Greg Albrecht <gba@gregalbrecht.com>
  4
+Copyright:: Copyright 2012 Greg Albrecht
  5
+License:: Apache License 2.0
  6
+-->
  7
+
  8
+
  9
+<nav>
  10
+    <view name="flashtimeline" default='true' />
  11
+    <collection label="Image Types">
  12
+        <view name="Instagram" />
  13
+        <view name="TOTAL_MEME" />
  14
+    </collection>
  15
+</nav>
14  default/data/ui/views/instagram.xml
... ...
@@ -0,0 +1,14 @@
  1
+<?xml version='1.0' encoding='utf-8'?>
  2
+<view template="dashboard.html">
  3
+  <module name="HiddenSavedSearch" autoRun="True" layoutPanel="panel_row1_col1">
  4
+    <param name="savedSearch">instagram</param>
  5
+    <module name="EventsViewer">
  6
+      <param name="count">50</param>
  7
+      <param name="enableBehavior">False</param>
  8
+      <param name="enableEventActions">False</param>
  9
+      <param name="enableFieldActions">False</param>
  10
+      <param name="enableTermSelection">False</param>
  11
+      <param name="maxLines">0</param>
  12
+    </module>
  13
+  </module>
  14
+</view>
14  default/data/ui/views/sandy.xml
... ...
@@ -0,0 +1,14 @@
  1
+<?xml version='1.0' encoding='utf-8'?>
  2
+<view template="dashboard.html">
  3
+  <module name="HiddenSavedSearch" autoRun="True" layoutPanel="panel_row1_col1">
  4
+    <param name="savedSearch">sandy</param>
  5
+    <module name="EventsViewer">
  6
+      <param name="count">50</param>
  7
+      <param name="enableBehavior">False</param>
  8
+      <param name="enableEventActions">False</param>
  9
+      <param name="enableFieldActions">False</param>
  10
+      <param name="enableTermSelection">False</param>
  11
+      <param name="maxLines">0</param>
  12
+    </module>
  13
+  </module>
  14
+</view>
8  twitter2/default/data/ui/views/twitter_drilldown.xml → default/data/ui/views/twix_drilldown.xml
... ...
@@ -1,4 +1,12 @@
1 1
 <?xml version='1.0' encoding='utf-8'?>
  2
+<!--
  3
+Source:: https://github.com/ampledata/twix
  4
+Author:: Greg Albrecht <gba@gregalbrecht.com>
  5
+Copyright:: Copyright 2012 Greg Albrecht
  6
+License:: Apache License 2.0
  7
+-->
  8
+
  9
+
2 10
 <form>
3 11
   <label>Twitter Per-User Activity</label>
4 12
   <fieldset>
8  twitter2/default/data/ui/views/twitter_general.xml → default/data/ui/views/twix_general.xml
... ...
@@ -1,4 +1,12 @@
1 1
 <?xml version='1.0' encoding='utf-8'?>
  2
+<!--
  3
+Source:: https://github.com/ampledata/twix
  4
+Author:: Greg Albrecht <gba@gregalbrecht.com>
  5
+Copyright:: Copyright 2012 Greg Albrecht
  6
+License:: Apache License 2.0
  7
+-->
  8
+
  9
+
2 10
 <dashboard>
3 11
   <label>Twitter General Activity</label>
4 12
   <row>
13  default/event_renderers.conf
... ...
@@ -0,0 +1,13 @@
  1
+#
  2
+# Source:: https://github.com/ampledata/twix
  3
+# Author:: Greg Albrecht <gba@gregalbrecht.com>
  4
+# Copyright:: Copyright 2012 Greg Albrecht
  5
+# License:: Apache License 2.0
  6
+#
  7
+
  8
+
  9
+[tweets_with_image]
  10
+eventtype = tweets_with_image
  11
+priority = 1
  12
+template = tweets_with_image.html
  13
+css_class = tweets_with_image
11  default/eventtypes.conf
... ...
@@ -0,0 +1,11 @@
  1
+#
  2
+# Source:: https://github.com/ampledata/twix
  3
+# Author:: Greg Albrecht <gba@gregalbrecht.com>
  4
+# Copyright:: Copyright 2012 Greg Albrecht
  5
+# License:: Apache License 2.0
  6
+#
  7
+
  8
+
  9
+[tweets_with_image]
  10
+search = *instagr*
  11
+#search = index="twix" *http*
12  default/indexes.conf
... ...
@@ -0,0 +1,12 @@
  1
+#
  2
+# Source:: https://github.com/ampledata/twix
  3
+# Author:: Greg Albrecht <gba@gregalbrecht.com>
  4
+# Copyright:: Copyright 2012 Greg Albrecht
  5
+# License:: Apache License 2.0
  6
+#
  7
+
  8
+
  9
+[twix]
  10
+coldPath = $SPLUNK_DB/twix/colddb
  11
+homePath = $SPLUNK_DB/twix/db
  12
+thawedPath = $SPLUNK_DB/twix/thaweddb
15  default/inputs.conf
... ...
@@ -0,0 +1,15 @@
  1
+#
  2
+# Source:: https://github.com/ampledata/twix
  3
+# Author:: Greg Albrecht <gba@gregalbrecht.com>
  4
+# Copyright:: Copyright 2012 Greg Albrecht
  5
+# License:: Apache License 2.0
  6
+#
  7
+
  8
+
  9
+[script://./bin/twix_stream.py]
  10
+disabled = 0
  11
+index = twix
  12
+interval = 60
  13
+source = twix
  14
+sourcetype = twix
  15
+passAuth = splunk-system-user
17  default/props.conf
... ...
@@ -0,0 +1,17 @@
  1
+#
  2
+# Source:: https://github.com/ampledata/twix
  3
+# Author:: Greg Albrecht <gba@gregalbrecht.com>
  4
+# Copyright:: Copyright 2012 Greg Albrecht
  5
+# License:: Apache License 2.0
  6
+#
  7
+
  8
+
  9
+[twix]
  10
+CHARSET = UTF-8
  11
+NO_BINARY_CHECK = 1
  12
+TIME_FORMAT = %a %b %d %H:%M:%S %z %Y
  13
+TIME_PREFIX = "__time":"
  14
+MAX_TIMESTAMP_LOOKAHEAD = 150
  15
+SHOULD_LINEMERGE = false
  16
+TZ = UTC
  17
+KV_MODE = json
40  default/savedsearches.conf
... ...
@@ -0,0 +1,40 @@
  1
+#
  2
+# Source:: https://github.com/ampledata/twix
  3
+# Author:: Greg Albrecht <gba@gregalbrecht.com>
  4
+# Copyright:: Copyright 2012 Greg Albrecht
  5
+# License:: Apache License 2.0
  6
+#
  7
+
  8
+
  9
+#search = eventtype="tweets_with_image" |spath path=entities.urls{}.display_url output=display_url | search display_url="*instagr*" OR display_url="*twitpic*" OR display_url="*yfrog*" OR display_url="*pikchur*"
  10
+#search = eventtype="tweets_with_image" |spath path=entities.urls{}.display_url output=display_url | search display_url="*instagr*"
  11
+
  12
+[instagram]
  13
+action.email.inline = 1
  14
+action.email.reportServerEnabled = 0
  15
+alert.digest_mode = True
  16
+alert.suppress = 0
  17
+alert.track = 0
  18
+cron_schedule = * * * * *
  19
+enableSched = 1
  20
+description = Instagram Images, mostly tasteful.
  21
+dispatch.earliest_time = rt-24h
  22
+dispatch.latest_time = rt
  23
+displayview = flashtimeline
  24
+request.ui_dispatch_view = flashtimeline
  25
+search = index="twix" eventtype="tweets_with_image" | spath path=entities.urls{}.display_url output=image_url 
  26
+
  27
+[sandy]
  28
+action.email.inline = 1
  29
+action.email.reportServerEnabled = 0
  30
+alert.digest_mode = True
  31
+alert.suppress = 0
  32
+alert.track = 0
  33
+cron_schedule = * * * * *
  34
+enableSched = 1
  35
+description = Sandy Images.
  36
+dispatch.earliest_time = 1350864000
  37
+dispatch.latest_time = 1351728000
  38
+displayview = flashtimeline
  39
+request.ui_dispatch_view = flashtimeline
  40
+search = index="hurricane_sandy" source="/opt/data/hurricane_sandy/twitter/oct_nov.sandy.tgz*" sourcetype="interaction" eventtype="tweets_with_image"  | spath path=links.url{} output=image_url 
14  twitter2/default/setup.xml → default/setup.xml
... ...
@@ -1,5 +1,13 @@
  1
+<!--
  2
+Source:: https://github.com/ampledata/twix
  3
+Author:: Greg Albrecht <gba@gregalbrecht.com>
  4
+Copyright:: Copyright 2012 Greg Albrecht
  5
+License:: Apache License 2.0
  6
+-->
  7
+
  8
+
1 9
 <setup>
2  
-    <block title="Welcome to the Twitter App">
  10
+    <block title="Welcome to twix">
3 11
         <text><![CDATA[
4 12
 To start indexing Twitter's sample stream please:<br/>
5 13
 <strong>
@@ -16,7 +24,7 @@ To start indexing Twitter's sample stream please:<br/>
16 24
         </input>
17 25
     </block>
18 26
     
19  
-    <block title="Enable Twitter scripted input" endpoint="data/inputs/script" entity=".%252Fbin%252Ftwitter_stream.py">
  27
+    <block title="Enable Twitter scripted input" endpoint="data/inputs/script" entity=".%252Fbin%252Ftwix_stream.py">
20 28
         <input field="interval">
21 29
             <label>Restart Interval (sec)</label>
22 30
             <type>text</type>
@@ -37,4 +45,4 @@ To start indexing Twitter's sample stream please:<br/>
37 45
             <type>password</type>
38 46
         </input>
39 47
     </block>
40  
-</setup>
  48
+</setup>
16  requirements.txt
... ...
@@ -0,0 +1,16 @@
  1
+# Requirements for twix
  2
+#
  3
+# Author:: Greg Albrecht <mailto:gba@splunk.com>
  4
+# Copyright:: Copyright 2012 Splunk, Inc.
  5
+# License:: Apache License 2.0
  6
+#
  7
+
  8
+
  9
+pylint
  10
+pep8
  11
+mock
  12
+nose
  13
+flake8
  14
+coverage
  15
+clonedigger
  16
+mako
7  roles/twix.rb
... ...
@@ -0,0 +1,7 @@
  1
+name 'twix'
  2
+
  3
+description 'Role for twix Dev Env.'
  4
+
  5
+run_list(
  6
+  'recipe[splunk]'
  7
+)
7  setup.cfg
... ...
@@ -0,0 +1,7 @@
  1
+[nosetests]
  2
+with-xunit = 1
  3
+#with-coverage = 1
  4
+#cover-html = 1
  5
+with-doctest = 1
  6
+doctest-tests = 1
  7
+#cover-package = bin
0  tests/__init__.py
No changes.
9  tests/test_template.py
... ...
@@ -0,0 +1,9 @@
  1
+#!/usr/bin/env python
  2
+
  3
+import unittest
  4
+from mako.template import Template
  5
+
  6
+class TestTemplate(unittest.TestCase):
  7
+
  8
+    def test_template(self):
  9
+        mytemplate = Template(filename='appserver/event_renderers/tweets_with_image.html')
21  twitter2/default/app.conf
... ...
@@ -1,21 +0,0 @@
1  
-#
2  
-# Splunk app configuration file
3  
-#
4  
-
5  
-[install]
6  
-is_configured = 0
7  
-
8  
-[ui]
9  
-is_visible = 1
10  
-label = Twitter
11  
-
12  
-[launcher]
13  
-author = Splunk
14  
-description = This application indexes Twitter's sample stream.
15  
-version = 2.0
16  
-
17  
-[credentials_settings]
18  
-verify_script = "$SPLUNK_HOME/bin/python" "$SPLUNK_HOME/etc/apps/twitter2/bin/twitter_verify_password.py"
19  
-
20  
-[package]
21  
-id = twitter2
9  twitter2/default/data/ui/nav/default.xml
... ...
@@ -1,9 +0,0 @@
1  
-<nav>
2  
-    <view name="flashtimeline" default='true' />
3  
-    <collection label="Views">
4  
-        <view source="unclassified" />
5  
-    </collection>
6  
-    <collection label="Searches &amp; Reports">
7  
-        <saved source="unclassified" />
8  
-    </collection>
9  
-</nav>
4  twitter2/default/indexes.conf
... ...
@@ -1,4 +0,0 @@
1  
-[twitter]
2  
-coldPath = $SPLUNK_DB/twitter/colddb
3  
-homePath = $SPLUNK_DB/twitter/db
4  
-thawedPath = $SPLUNK_DB/twitter/thaweddb
7  twitter2/default/inputs.conf
... ...
@@ -1,7 +0,0 @@
1  
-[script://./bin/twitter_stream.py]
2  
-disabled = 0
3  
-index = twitter
4  
-interval = 60
5  
-source = twitter
6  
-sourcetype = twitter
7  
-passAuth = splunk-system-user
9  twitter2/default/props.conf
... ...
@@ -1,9 +0,0 @@
1  
-[twitter]
2  
-CHARSET = UTF-8
3  
-NO_BINARY_CHECK = 1
4  
-TIME_FORMAT = %a %b %d %H:%M:%S %z %Y
5  
-TIME_PREFIX = "__time":"
6  
-MAX_TIMESTAMP_LOOKAHEAD = 150
7  
-SHOULD_LINEMERGE = false
8  
-TZ = UTC
9  
-KV_MODE = json
105  twitter2/default/savedsearches.conf
... ...
@@ -1,105 +0,0 @@
1  
-[Tweet Stream]
2  
-action.email.inline = 1
3  
-action.email.reportServerEnabled = 0
4  
-alert.digest_mode = True
5  
-alert.suppress = 0
6  
-alert.track = 0
7  
-cron_schedule = * * * * *
8  
-dispatch.earliest_time = rt-30s
9  
-dispatch.latest_time = rt
10  
-displayview = flashtimeline
11  
-request.ui_dispatch_view = flashtimeline
12  
-search = index=twitter text=* | table text | sort -_time
13  
-vsid = h324tlu5
14  
-
15  
-[Tweet Stream for First-Time Users]
16  
-action.email.inline = 1
17  
-action.email.reportServerEnabled = 0
18  
-alert.digest_mode = True
19  
-alert.suppress = 0
20  
-alert.track = 0
21  
-cron_schedule = * * * * *
22  
-dispatch.earliest_time = rt-1m
23  
-dispatch.latest_time = rt
24  
-displayview = flashtimeline
25  
-request.ui_dispatch_view = flashtimeline
26  
-search = index=twitter user.statuses_count=1 | rename user.screen_name as screenname | table screenname text | sort -_time
27  
-vsid = h3255fsr
28  
-
29  
-[Tweet Time Zones]
30  
-action.email.inline = 1
31  
-action.email.reportServerEnabled = 0
32  
-alert.digest_mode = True
33  
-alert.suppress = 0
34  
-alert.track = 0
35  
-cron_schedule = * * * * *
36  
-dispatch.earliest_time = -15m@m
37  
-dispatch.latest_time = now
38  
-displayview = flashtimeline
39  
-request.ui_dispatch_view = flashtimeline
40  
-search = index=twitter | rename user.utc_offset as z | search z=* z!=null | eval z=round(z/3600) | stats count by z | sort +z
41  
-vsid = h325n0mk
42  
-
43  
-[Tweet Locations]
44  
-action.email.reportServerEnabled = 0
45  
-alert.suppress = 0
46  
-alert.track = 0
47  
-dispatch.earliest_time = 0
48  
-displayview = maps
49  
-request.ui_dispatch_view = maps
50  
-search = index=twitter coordinates.type=Point | rename coordinates.coordinates{} as lnglat | eval _geo=mvindex(lnglat,1)+","+mvindex(lnglat,0)
51  
-vsid = h34zyyq2
52  
-
53  
-[Top Hashtags]
54  
-action.email.inline = 1
55  
-action.email.reportServerEnabled = 0
56  
-alert.digest_mode = True
57  
-alert.suppress = 0
58  
-alert.track = 0
59  
-cron_schedule = * * * * *
60  
-dispatch.earliest_time = -15m@m
61  
-dispatch.latest_time = now
62  
-displayview = flashtimeline
63  
-request.ui_dispatch_view = flashtimeline
64  
-search = index=twitter | rename entities.hashtags{}.text as hashtags | fields hashtags | mvexpand hashtags | top hashtags
65  
-vsid = h324eqgm
66  
-
67  
-[Top Mentions]
68  
-action.email.inline = 1
69  
-action.email.reportServerEnabled = 0
70  
-alert.digest_mode = True
71  
-alert.suppress = 0
72  
-alert.track = 0
73  
-cron_schedule = * * * * *
74  
-dispatch.earliest_time = -15m@m
75  
-dispatch.latest_time = now
76  
-displayview = flashtimeline
77  
-request.ui_dispatch_view = flashtimeline
78  
-search = index=twitter | rename entities.user_mentions{}.screen_name as mentions | fields mentions | mvexpand mentions | top mentions
79  
-vsid = h324nrf5
80  
-
81  
-[Top User Agents]
82  
-action.email.inline = 1
83  
-action.email.reportServerEnabled = 0
84  
-alert.digest_mode = True
85  
-alert.suppress = 0
86  
-alert.track = 0
87  
-cron_schedule = * * * * *
88  
-dispatch.earliest_time = -24h@h
89  
-dispatch.latest_time = now
90  
-displayview = flashtimeline
91  
-request.ui_dispatch_view = flashtimeline
92  
-search = index=twitter | spath source | fields source | rex field=source "(<[^>]*>)?(?<source>[^<]*)" | top source
93  
-vsid = h3262mmu
94  
-
95  
-[Top Users]
96  
-action.email.inline = 1
97  
-action.email.reportServerEnabled = 0
98  
-alert.digest_mode = True
99  
-alert.suppress = 0
100  
-alert.track = 0
101  
-dispatch.earliest_time = 0
102  
-displayview = flashtimeline
103  
-request.ui_dispatch_view = flashtimeline
104  
-search = index=twitter | rename user.screen_name as screenname | top screenname
105  
-vsid = h2xtugf6
202  twitter2/default/viewstates.conf
... ...
@@ -1,202 +0,0 @@
1  
-[flashtimeline:h2xtugf6]
2  
-AxisScaleFormatter_0_18_0.default = ""
3  
-ButtonSwitcher_0_8_0.selected = splIcon-results-table
4  
-ChartTypeFormatter_0_13_0.default = column
5  
-DataOverlay_0_13_0.dataOverlayMode = none
6  
-DataOverlay_0_13_0.default = none
7  
-FieldPicker_0_5_1.fields = host,sourcetype,source
8  
-FieldPicker_0_5_1.sidebarDisplay = True
9  
-FlashTimeline_0_4_1.height = 95px
10  
-FlashTimeline_0_4_1.minimized = False
11  
-JSChart_0_13_1.height = 300px
12  
-LegendFormatter_0_19_0.default = right
13  
-MaxLines_0_13_0.default = 10
14  
-MaxLines_0_13_0.maxLines = 10
15  
-NullValueFormatter_0_18_0.default = gaps
16  
-RowNumbers_0_12_0.default = true
17  
-RowNumbers_0_12_0.displayRowNumbers = true
18  
-RowNumbers_1_12_0.default = true
19  
-RowNumbers_1_12_0.displayRowNumbers = true
20  
-Segmentation_0_14_0.default = full
21  
-Segmentation_0_14_0.segmentation = full
22  
-SoftWrap_0_11_0.enable = True
23  
-SplitModeFormatter_0_17_0.default = false
24  
-StackModeFormatter_0_16_0.default = default
25  
-YAxisRangeMaximumFormatter_0_17_0.default = ""
26  
-YAxisRangeMinimumFormatter_0_16_0.default = ""
27  
-
28  
-[flashtimeline:h324eqgm]
29  
-AxisScaleFormatter_0_18_0.default = ""
30  
-ButtonSwitcher_0_8_0.selected = splIcon-results-table
31  
-ChartTypeFormatter_0_13_0.default = bar
32  
-Count_0_7_1.default = 50
33  
-DataOverlay_0_13_0.dataOverlayMode = none
34  
-DataOverlay_0_13_0.default = none
35  
-FieldPicker_0_5_1.fields = host,sourcetype,source,created_at,time,data,hashtags
36  
-FieldPicker_0_5_1.sidebarDisplay = True
37  
-FlashTimeline_0_4_1.height = 95px
38  
-FlashTimeline_0_4_1.minimized = False
39  
-JSChart_0_13_1.height = 300px
40  
-LegendFormatter_0_19_0.default = right
41  
-MaxLines_0_13_0.default = 10
42  
-MaxLines_0_13_0.maxLines = 10
43  
-NullValueFormatter_0_18_0.default = gaps
44  
-RowNumbers_0_12_0.default = true
45  
-RowNumbers_0_12_0.displayRowNumbers = true
46  
-RowNumbers_1_12_0.default = true
47  
-RowNumbers_1_12_0.displayRowNumbers = true
48  
-Segmentation_0_14_0.default = full
49  
-Segmentation_0_14_0.segmentation = full
50  
-SoftWrap_0_11_0.enable = True
51  
-SplitModeFormatter_0_17_0.default = false
52  
-StackModeFormatter_0_16_0.default = default
53  
-YAxisRangeMaximumFormatter_0_17_0.default = ""
54  
-YAxisRangeMinimumFormatter_0_16_0.default = ""
55  
-
56  
-[flashtimeline:h324nrf5]
57  
-AxisScaleFormatter_0_18_0.default = ""
58  
-ButtonSwitcher_0_8_0.selected = splIcon-results-table
59  
-ChartTypeFormatter_0_13_0.default = bar
60  
-Count_0_7_1.default = 50
61  
-DataOverlay_0_13_0.dataOverlayMode = none
62  
-DataOverlay_0_13_0.default = none
63  
-FieldPicker_0_5_1.fields = host,sourcetype,source,created_at,time,data,hashtags
64  
-FieldPicker_0_5_1.sidebarDisplay = True
65  
-FlashTimeline_0_4_1.height = 95px
66  
-FlashTimeline_0_4_1.minimized = False
67  
-JSChart_0_13_1.height = 300px
68  
-LegendFormatter_0_19_0.default = right
69  
-MaxLines_0_13_0.default = 10
70  
-MaxLines_0_13_0.maxLines = 10
71  
-NullValueFormatter_0_18_0.default = gaps
72  
-RowNumbers_0_12_0.default = true
73  
-RowNumbers_0_12_0.displayRowNumbers = true
74  
-RowNumbers_1_12_0.default = true
75  
-RowNumbers_1_12_0.displayRowNumbers = true
76  
-Segmentation_0_14_0.default = full
77  
-Segmentation_0_14_0.segmentation = full
78  
-SoftWrap_0_11_0.enable = True
79  
-SplitModeFormatter_0_17_0.default = false
80  
-StackModeFormatter_0_16_0.default = default
81  
-YAxisRangeMaximumFormatter_0_17_0.default = ""
82  
-YAxisRangeMinimumFormatter_0_16_0.default = ""
83  
-
84  
-[flashtimeline:h324tlu5]
85  
-AxisScaleFormatter_0_18_0.default = ""
86  
-ButtonSwitcher_0_8_0.selected = splIcon-results-table
87  
-ChartTypeFormatter_0_13_0.default = bar
88  
-Count_0_7_1.default = 50
89  
-DataOverlay_0_13_0.dataOverlayMode = none
90  
-DataOverlay_0_13_0.default = none
91  
-FieldPicker_0_5_1.fields = host,sourcetype,source,created_at,time,data,hashtags
92  
-FieldPicker_0_5_1.sidebarDisplay = True
93  
-FlashTimeline_0_4_1.height = 95px
94  
-FlashTimeline_0_4_1.minimized = False
95  
-JSChart_0_13_1.height = 300px
96  
-LegendFormatter_0_19_0.default = right
97  
-MaxLines_0_13_0.default = 10
98  
-MaxLines_0_13_0.maxLines = 10
99  
-NullValueFormatter_0_18_0.default = gaps
100  
-RowNumbers_0_12_0.default = true
101  
-RowNumbers_0_12_0.displayRowNumbers = true
102  
-RowNumbers_1_12_0.default = true
103  
-RowNumbers_1_12_0.displayRowNumbers = true
104  
-Segmentation_0_14_0.default = full
105  
-Segmentation_0_14_0.segmentation = full
106  
-SoftWrap_0_11_0.enable = True
107  
-SplitModeFormatter_0_17_0.default = false
108  
-StackModeFormatter_0_16_0.default = default
109  
-YAxisRangeMaximumFormatter_0_17_0.default = ""
110  
-YAxisRangeMinimumFormatter_0_16_0.default = ""
111  
-
112  
-[flashtimeline:h3255fsr]
113  
-AxisScaleFormatter_0_18_0.default = ""
114  
-ButtonSwitcher_0_8_0.selected = splIcon-results-table
115  
-ChartTypeFormatter_0_13_0.default = bar
116  
-Count_0_7_1.default = 50
117  
-DataOverlay_0_13_0.dataOverlayMode = none
118  
-DataOverlay_0_13_0.default = none
119  
-FieldPicker_0_5_1.fields = host,sourcetype,source,created_at,time,data,hashtags,screenname
120  
-FieldPicker_0_5_1.sidebarDisplay = True
121  
-FlashTimeline_0_4_1.height = 95px
122  
-FlashTimeline_0_4_1.minimized = False
123  
-JSChart_0_13_1.height = 300px
124  
-LegendFormatter_0_19_0.default = right
125  
-MaxLines_0_13_0.default = 10
126  
-MaxLines_0_13_0.maxLines = 10
127  
-NullValueFormatter_0_18_0.default = gaps
128  
-RowNumbers_0_12_0.default = true
129  
-RowNumbers_0_12_0.displayRowNumbers = true
130  
-RowNumbers_1_12_0.default = true
131  
-RowNumbers_1_12_0.displayRowNumbers = true
132  
-Segmentation_0_14_0.default = full
133  
-Segmentation_0_14_0.segmentation = full
134  
-SoftWrap_0_11_0.enable = True
135  
-SplitModeFormatter_0_17_0.default = false
136  
-StackModeFormatter_0_16_0.default = default
137  
-YAxisRangeMaximumFormatter_0_17_0.default = ""
138  
-YAxisRangeMinimumFormatter_0_16_0.default = ""
139  
-
140  
-[flashtimeline:h325n0mk]
141  
-AxisScaleFormatter_0_18_0.default = ""
142  
-ButtonSwitcher_0_8_0.selected = splIcon-results-chart
143  
-ChartTypeFormatter_0_13_0.default = column
144  
-Count_0_7_1.default = 50
145  
-DataOverlay_0_13_0.dataOverlayMode = none
146  
-DataOverlay_0_13_0.default = none
147  
-FieldPicker_0_5_1.fields = host,sourcetype,source,created_at,time,data,hashtags,screenname,user.time_zone,user.utc_offset
148  
-FieldPicker_0_5_1.sidebarDisplay = True
149  
-FlashTimeline_0_4_1.height = 95px
150  
-FlashTimeline_0_4_1.minimized = False
151  
-JSChart_0_13_1.height = 300px
152  
-LegendFormatter_0_19_0.default = right
153  
-MaxLines_0_13_0.default = 10
154  
-MaxLines_0_13_0.maxLines = 10
155  
-NullValueFormatter_0_18_0.default = gaps
156  
-RowNumbers_0_12_0.default = true
157  
-RowNumbers_0_12_0.displayRowNumbers = true
158  
-RowNumbers_1_12_0.default = true
159  
-RowNumbers_1_12_0.displayRowNumbers = true
160  
-Segmentation_0_14_0.default = full
161  
-Segmentation_0_14_0.segmentation = full
162  
-SoftWrap_0_11_0.enable = True
163  
-SplitModeFormatter_0_17_0.default = false
164  
-StackModeFormatter_0_16_0.default = default
165  
-YAxisRangeMaximumFormatter_0_17_0.default = ""
166  
-YAxisRangeMinimumFormatter_0_16_0.default = ""
167  
-
168  
-[flashtimeline:h3262mmu]
169  
-AxisScaleFormatter_0_18_0.default = ""
170  
-ButtonSwitcher_0_8_0.selected = splIcon-results-chart
171  
-ChartTypeFormatter_0_13_0.default = pie
172  
-Count_0_7_1.default = 50
173  
-DataOverlay_0_13_0.dataOverlayMode = none
174  
-DataOverlay_0_13_0.default = none
175  
-FieldPicker_0_5_1.fields = host,sourcetype,source,created_at,time,data,hashtags,screenname,user.time_zone,user.utc_offset
176  
-FieldPicker_0_5_1.sidebarDisplay = True
177  
-FlashTimeline_0_4_1.height = 95px
178  
-FlashTimeline_0_4_1.minimized = False
179  
-JSChart_0_13_1.height = 300px
180  
-LegendFormatter_0_19_0.default = right
181  
-MaxLines_0_13_0.default = 10
182  
-MaxLines_0_13_0.maxLines = 10
183  
-NullValueFormatter_0_18_0.default = gaps
184  
-RowNumbers_0_12_0.default = true
185  
-RowNumbers_0_12_0.displayRowNumbers = true
186  
-RowNumbers_1_12_0.default = true
187  
-RowNumbers_1_12_0.displayRowNumbers = true
188  
-Segmentation_0_14_0.default = full
189  
-Segmentation_0_14_0.segmentation = full
190  
-SoftWrap_0_11_0.enable = True
191  
-SplitModeFormatter_0_17_0.default = false
192  
-StackModeFormatter_0_16_0.default = default
193  
-YAxisRangeMaximumFormatter_0_17_0.default = ""
194  
-YAxisRangeMinimumFormatter_0_16_0.default = ""
195  
-
196  
-[maps:h34zyyq2]
197  
-FlashTimeline_0_5_0.height = 140px
198  
-FlashTimeline_0_5_0.minimized = False
199  
-GoogleMaps_0_7_0.center = 40.45005637612038,-82.48964843750001
200  
-GoogleMaps_0_7_0.mapType = roadmap
201  
-GoogleMaps_0_7_0.zoomLevel = 3
202  
-SoftWrap_0_9_0.enable = true
5  twix.gems
... ...
@@ -0,0 +1,5 @@
  1
+# default.gems generated gem export file. Note that any env variable settings will be missing. Append these after using a ';' field separator
  2
+foodcritic
  3
+librarian
  4
+vagrant
  5
+hub

No commit comments for this range

Something went wrong with that request. Please try again.