View GoGenHandler.py
class GoGenHandler:
def __init__(self,**args):
self.index = args['index']
self.source = args['source']
self.sourcetype = args['sourcetype']
self.host = args['host']
def __call__(self,raw_cmd_output):
print "<stream><event><data>%s</data><source>%s</source><sourcetype>%s</sourcetype><index>%s</index><host>%s</host></event></stream>" % (encodeXMLText(raw_cmd_output),self.source,self.sourcetype,self.index,self.host)
View Splunkbasehandler.py
class SplunkbaseHandler:
def __init__(self,**args):
pass
def __call__(self, response_object,raw_response_output,response_type,req_args,endpoint):
if response_type == "json":
output = json.loads(raw_response_output)
offset = output["offset"]
total = output["total"]
View LocalMQConnectionFactory.java
package com.splunk.modinput.jms.custom.factory;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Map;
import javax.jms.ConnectionFactory;
import javax.jms.Queue;
import javax.jms.Topic;
View BodyOnlyMessageHandler.java
package com.splunk.modinput.kafka;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.splunk.modinput.Stream;
import com.splunk.modinput.StreamEvent;
View BodyOnlyMessageHandler.java
package com.splunk.modinput.mqtt;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import com.splunk.modinput.Stream;
View com.foo.modinput.amqp.JSONMessageHandler.java
package com.splunk.modinput.amqp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Envelope;
import com.splunk.modinput.Stream;
import com.splunk.modinput.StreamEvent;
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View responsehandlers.py
import json
import requests
#the default handler , does nothing , just passes the raw output directly to STDOUT
class DefaultResponseHandler:
def __init__(self,**args):
pass
def __call__(self, response_object,raw_response_output,response_type,req_args,endpoint):
View PayloadOnlyMessageHandler.java
package com.splunk.modinput.jms.customhandler;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.jms.Message;
import com.splunk.modinput.Stream;
import com.splunk.modinput.StreamEvent;
View FoursquareCheckins
[rest://foursquare_checkins]
auth_type = none
endpoint = https://api.foursquare.com/v2/users/self/checkins
http_method = GET
index_error_response_codes = 1
response_handler = FourSquareCheckinsEventHandler
response_type = json
sourcetype = 4sq_checkins
index = main
streaming_request = 0