Skip to content

Instantly share code, notes, and snippets.

Damien Dallimore damiendallimore

Block or report user

Report or block damiendallimore

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@damiendallimore
damiendallimore / listEvents_example.txt
Created Nov 12, 2013
Example Splunk REST API stanza settings for polling the Cloudstack listEvents API endpoint. http://cloudstack.apache.org/docs/api/apidocs-4.1/TOC_Domain_Admin.html
View listEvents_example.txt
Endpoint URL
https://foobar.com/client/api
HTTP Method
GET
Authentication Type
@damiendallimore
damiendallimore / authhandlers.py
Created Nov 12, 2013
Custom Auth handler that the Splunk REST API Modular Input can use to connect to the Cloudstack REST API
View authhandlers.py
from requests.auth import AuthBase
import hmac
import base64
import hashlib
import urlparse
import urllib
class CloudstackAuth(AuthBase):
def __init__(self,**args):
@damiendallimore
damiendallimore / Splunk_Search_Splunk_Java_Agent_Method_Analysis
Last active Dec 22, 2015
Splunk Search for method tracing events collected by Splunk Java Agent
View Splunk_Search_Splunk_Java_Agent_Method_Analysis
index=main sourcetype=splunk-java-agent name=method* | transaction appName,threadID,className,methodName startswith="method_entered" endswith="method_exited" | stats min(duration) as "Min Execution Time" max(duration) as "Max Execution Time" avg(duration) as "Avg Execution Time" count as "Total Calls" sum(duration) as "Cumulative Execution Time" by className,methodName
@damiendallimore
damiendallimore / Splunk_Search_Java_Stacktace
Created Sep 12, 2013
Splunk Search for Java Exception Stacktrace events formatted by Splunk Java Logging
View Splunk_Search_Java_Stacktace
index=main sourcetype=logback throwable_class | makemv delim="," stacktrace_elements | table _time throwable_message throwable_class stacktrace_elements
View TcpInputDataExample.java
/**
* Stream some data to Splunk over raw TCP
*/
private static void tcpInputDataExample() {
Service splunkService = connectAndLoginToSplunkExample();
// Retrieve the input
TcpInput myInput = (TcpInput) splunkService.getInputs().get("5153");
// Open the socket and stream
View UdpInputDataExample.java
/**
* Send some data to Splunk over UDP
*/
private static void udpInputDataExample() {
Service splunkService = connectAndLoginToSplunkExample();
// Get a UDP input to send to
UdpInput myInput = (UdpInput) splunkService.getInputs().get("9999");
View UploadFileExample.java
/**
* Perform a oneshot file upload
*/
private static void uploadFileExample() {
Service splunkService = connectAndLoginToSplunkExample();
// Retrieve the index for the data
Index myIndex = splunkService.getIndexes().get("main");
View CreateRoleExample.java
/**
* Create a role and then update it
*/
private static void createRoleExample() {
Service splunkService = connectAndLoginToSplunkExample();
// Create a new role called 'testrole'
Role role = splunkService.getRoles().create("testrole");
View CreateUserExample.java
/**
* Create a user and then update it
*/
private static void createUserExample() {
Service splunkService = connectAndLoginToSplunkExample();
String username = "testuser";
String password = "changeme";
String[] roles = { "power", "testrole" };
User user = splunkService.getUsers().create(username, password, roles);
View NamespaceGetEntityExample.java
/**
* Get a list of objects(saved searches) in a namespace
*/
private static void namespaceGetEntityExample() {
Service splunkService = connectAndLoginToSplunkExample();
ServiceArgs namespace = new ServiceArgs();
namespace.setOwner("admin");
namespace.setApp("search");
SavedSearchCollection savedSearches = splunkService.getSavedSearches(namespace);
You can’t perform that action at this time.