SlideShare una empresa de Scribd logo
1 de 34
Splunk Developer Platform
Damien Dallimore
Developer Evangelist
Copyright©2013,SplunkInc.
Splunk & Developers
2
REST API
Custom/Existin
g Applications
SDKs
Search, chart and graph
Save and schedule searches as alerts
Export search results
Manage inputs and indexes
Add & remove users and roles
SplunkUI
(Splunk Apps)
Machine Data
Engine
Copyright©2013,SplunkInc.
The Splunk REST API
3
• Exposes an API method for every feature in the product
– Whatever you can do in the UI – you can do through the API
– Run searches
– Manage Splunk configurations
• API is RESTful
– Endpoints are served by Splunkd
– Requestsare GET, POST, and DELETE HTTP methods
– Responses are Atom XML Feeds or JSON
– Versioning Support
– Search results can be output in CSV/JSON/XML/Raw
– Authentication is token based
Copyright©2013,SplunkInc.
Developer Platform
4
• We want to make it as easy as possible for developers to build Big Data apps and
custom integrations on top of the Splunk platform
• Several different language offerings, Software Development Kits (SDKs)
• Javascript, Java, Python, PHP, C#, Ruby
• Our SDKs make it easier to use the REST API
• All Splunk functionality is accessible via our SDKs
• Get Data into Splunk
• Execute Splunk Searches, get data out of Splunk
• Manage Splunk
• Customized User Interfaces
Copyright©2013,SplunkInc.
Top 3 Developer Takeaways
• Every developer can use Splunk to
accelerate dev & test and gain application
intelligence
• The developer platform lets customers
customize and extend the power of Splunk
• Splunk lets developers build big data apps
with the skills they already have
Copyright©2013,SplunkInc.
Takeaway 1: Use Splunk to accelerate dev & test
6
• Splunk frees you from upfront database design for analytics
• late binding schema
• Developers and QA/test engineers don’t have to ask IT/Ops to get logs off machines
• Role base access to all data within one console without having to log into
production systems
• All events are indexed and accessible in real-time in one place.
• Ad-Hoc real-time monitoring and historical investigation searchable from one
place
• Correlations and insights across multiple tiers.
• Splunk lets you find issues quickly, so you can fix issues quickly
• Integrate Splunk search results into testing assertions
Copyright©2013,SplunkInc.
Takeaway 2: Customize and extend Splunk
7
Integrate data from
Splunk into existing apps
and systems
Build custom line-of-
business apps powered
by Splunk
Deliver Operational Intelligence to marketing, sales, customer service and other
divisions beyond IT in the systems and apps that make sense to them.
REST API & SDKs
Copyright©2013,SplunkInc.
Takeaway 3: Splunk lets developers build big data apps
with the skills they already have
8
• Developers can use the languages and
frameworks they know and love – like
Python, JavaScript, Java and PHP.
• No need to write MapReduce jobs, learn R
or be some kind of scientist to build apps
that use Big Data – be a developer!
Using the Python SDK to deliver customers real-
time security intelligence into custom dashboards
Splunks 7 million API calls per day and exposes
Splunk data to customers in their customer-facing
web app via REST API
Copyright©2013,SplunkInc.
Why choose to develop on Splunk ?
9
• Splunk is not agnostic of its underlying data source , MapR algorithm optimized to Splunk index files
• Real time vs Batch Jobs
• Optimal for time series based data
• End to End Integrated Big Data Solution
• Fine grained protection of access and data using role based permissions
• Data retention and aging controls
• Users can submit “Map Reduce” jobs without needing to know how to code a MapR job
• Get the best of many worlds ie: Splunk Hadoop Connect
• Splunk integrates easily with other systems, developers can then just focus on developing against 1 single platform
Custom Visualizations
Copyright©2013,SplunkInc.
Visualizing Splunk with the SDKs
11
• Splunkweb has rich, but sometimes limited, visualization options
• You can use the SDKs to extract data from Splunk using a search, and
visualize it in an entirely custom manner
• Using the Javascript SDK you can integrate with third party charting
librarys like Google Charts, Rickshaw, D3,three.js etc..
Copyright©2013,SplunkInc.
Development Approaches
12
• Custom Advanced XML Modules
• Incorporate into Views in SplunkWeb Apps
• Share on Splunkbase or reuse internally
• Use our new “Application Framework” (in preview mode currently)
• Use our Python and Javascript SDK’s
• Leverage your skills with other JS librarys (Backbone, JQuery)
• Leverage the power of Django
• Shareable UI components
• Simple XML parser
• Code your own standalone application
• Use any of our SDKs to build your own solution and UI (web based, fat, mobile)
Copyright©2013,SplunkInc.
Copyright©2013,SplunkInc.
Copyright©2013,SplunkInc.
Copyright©2013,SplunkInc.
Copyright©2013,SplunkInc.
My Guiding Viz Principle
17
The visualization must be simple and intuitive to understand and derive meaning from at a glance.
Cool viz , but what are you telling me ?
SDK Code Examples
Splunk SDK for Java
Copyright©2013,SplunkInc.
Get the Java SDK
19
• Open sourced under the Apache v2.0 license
• Clone from Github : git clone https://github.com/splunk/splunk-sdk-java.git
• Project levelsupport for Eclipse and IntellijIDE’s
• Pre-requisites
• JRE6+
• Ant , Maven coming
• Splunk installed
• Loadsof code examples
• Project examplesfolder
• Unit Tests
• http://dev.splunk.com
• http://gist.github.com/damiendallimore
• Comprehensivecoverageof the REST API
• Tutorialvideos availableat http://dev.splunk.com
Copyright©2013,SplunkInc.
Java SDK Class Model
20
Service
Resource
ResourceCollection Entity
EntityCollection Application Index
HTTPService
Input
InputCollection SavedSearchCollection
• Collections use a common mechanism to create and remove entities
• Entities use a common mechanism to retrieve and update property values, and access entity metadata
• Service is a wrapper that facilitates access to all Splunk REST endpoints
Copyright©2013,SplunkInc.
Key Java SDK use cases
21
• Connect and Authenticate
• Manage
• Input Events
• Search
Copyright©2013,SplunkInc.
Connect and Authenticate
22
public static Service connectAndLoginToSplunkExample() {
Map<String, Object> connectionArgs = new HashMap<String, Object>();
connectionArgs.put("host", ”somehost");
connectionArgs.put("username", ”spring");
connectionArgs.put("password", ”integration");
connectionArgs.put("port", 8089);
connectionArgs.put("scheme", "https");
// will login and save the session key which gets put in the HTTP Authorization header
Service splunkService = Service.connect(connectionArgs);
return splunkService;
}
Copyright©2013,SplunkInc.
Manage
23
public static void getServerInfoExample() {
Service splunkService = connectAndLoginToSplunkExample();
ServiceInfo info = splunkService.getInfo();
System.out.println("Info:");
for (String key : info.keySet())
System.out.println(" " + key + ": " + info.get(key));
Entity settings = splunkService.getSettings();
System.out.println("nSettings:");
for (String key : settings.keySet())
System.out.println(" " + key + ": " + settings.get(key));
}
Copyright©2013,SplunkInc.
Input Events
24
public static void logEventToSplunkExample() {
Service splunkService = connectAndLoginToSplunkExample();
// Get a Receiver object
Receiver receiver = splunkService.getReceiver();
// Set the sourcetype
Args logArgs = new Args();
logArgs.put("source", ”http-rest");
logArgs.put("sourcetype", ”spring-example");
// Log an event into the spring index
receiver.log(”spring", logArgs, ”SpringOne 2GX rocks");
}
• Other Input transports
• HTTP REST Streaming
• Raw TCP Oneshot & Streaming
• Raw UDP & Syslog
Copyright©2013,SplunkInc.
Semantic Logging
Log anything that can add value when aggregated, charted or further analyzed
Example Bogus Pseudo-Code:
void submitPurchase(purchaseId)
{
log.info("action=submitPurchaseStart, purchaseId=%d", purchaseId)
//these calls throw an exception on error
submitToCreditCard(...)
generateInvoice(...)
generateFullfillmentOrder(...)
log.info("action=submitPurchaseCompleted, purchaseId=%d", purchaseId)
}
• Create Human Readable Events
• Clearly Timestamp Events
• Use Key-Value Pairs (JSON Logging)
• Separate Multi-Value Events
• Log Unique Identifiers
Copyright©2013,SplunkInc.
Search
26
• Search query
• a set of commands and functions you use to retrieve events from an index or a real-time stream , "search
index=spring error OR exception | head 10”
• Saved search
• a search query that has been saved to be used again and can be set up to run on a regular schedule
• Search job
• an instance of a completed or still-running search operation.Using a search ID you can access the results of the
search when they become available. Job results are saved for a period of time on the server and can be retrieved
• Search Modes
• Normal : asynchronous , poll job for status and results
• Realtime : same as normal, but stream is kept open a results streamed in realtime
• Blocking : synchronous , a job handle is returned when search is completed
• Oneshot : synchronous , no job handle is returned, results are streamed
• Export : synchronous, not a search per say, doesn’t return a job handle, results are streamed oldest to newest
Copyright©2013,SplunkInc.
Blocking Searches (Oneshot)
27
public static void simpleSearchExample() {
Service splunkService = connectAndLoginToSplunkExample();
String searchQuery = "search error OR exception| head 10";
Args queryArgs = new Args();
queryArgs.put("earliest_time", "-3d@d");
queryArgs.put("latest_time", "-1d@d");
// perform the search , blocks here
InputStream stream = splunkService.search(searchQuery, queryArgs);
processInputStream(stream);
}
Copyright©2013,SplunkInc.
Blocking Searches (Export)
28
public static void exportSearchExample() {
Service splunkService = connectAndLoginToSplunkExample();
String searchQuery = "search error OR exception | head 10";
Args queryArgs = new Args();
queryArgs.put("earliest_time", "-1d@d");
queryArgs.put("latest_time", "now");
// perform the export , blocks here
InputStream stream = splunkService.export(searchQuery, queryArgs);
processInputStream(stream);
}
Copyright©2013,SplunkInc.
Non Blocking Search
29
public static void searchJobExample() {
Service splunkService = connectAndLoginToSplunkExample();
String outputMode = "csv";// xml,json,csv
// submit the job
Job job = splunkService.getJobs().create("search index=spring error OR fatal | head 10");
while (!job.isDone()) {
try {Thread.sleep(500);}
catch (Exception e) {}
}
Args outputArgs = new Args();
outputArgs.put("output_mode", outputMode);
InputStream stream = job.getResults(outputArgs);
processInputStream(stream, outputMode); // uses xml stream, opencsv and gson
}
Copyright©2013,SplunkInc.
Realtime Search
30
public static void realTimeSearchExample() {
Service splunkService = connectAndLoginToSplunkExample();
Args queryArgs = new Args();
queryArgs.put("earliest_time", "rt-5m");
queryArgs.put("latest_time", "rt");
// submit the job
Job job = splunkService.getJobs().create("search index=spring exception OR error”, queryArgs);
…
}
Copyright©2013,SplunkInc.
Alternate JVM Languages
31
Scala Groovy Clojure
Javascript(Rhino) JRuby PHP(Quercus)
Ceylon Kotlin Jython
We don’t need SDK’s for these languages , we can just use the Java SDK !
Copyright©2013,SplunkInc.
Groovy
32
class SplunkJavaSDKWrapper {
static main(args) {
//connect and login
def connectionParameters = [host:”somehost",username:"spring",password:"integration"]
Service service = Service.connect(connectionParameters)
//get Splunk Server info
ServiceInfo info = service.getInfo()
def splunkInfo = [:]
for (key in info.keySet())
splunkInfo.put(key,info.get(key))
printSplunkInfo(splunkInfo)
}
static printSplunkInfo(splunkInfo) {
println "Info”
splunkInfo.each { key, value ->println key + " : " + value}
}
}
Copyright©2013,SplunkInc.
Scala
33
importcom.splunk.Service._
importscala.collection.mutable.HashMap
importscala.collection.JavaConversions._
objectSplunkJavaSDKWrapper{
def main(args:Array[String]) = {
//connectand login
valconnectionArgs= HashMap[String,Object]("host"->”somehost”,"username"->”me”,"password"->”foo")
valservice= connect(connectionArgs)
//get SplunkServerinfo
valinfo= service.getInfo
// Scala/Javaconversion
valjavaSet= info.keySet
valscalaSet= javaSet.toSet
//print out SplunkServerinfo
for (key <- scalaSet)
println(key+ ":"+ info.get(key))
}
}
Copyright©2013,SplunkInc.
Contact me
34
Email : ddallimore@splunk.com
Twitter : @damiendallimore
Skype : damien.dallimore
Github : damiendallimore
Splunkbase : damiend
Slideshare : http://www.slideshare.net/damiendallimore
Blogs : http://blogs.splunk.com/dev
Web : http://dev.splunk.com

Más contenido relacionado

La actualidad más candente

Automation for the Modern Enterprise_26oct2017
Automation for the Modern Enterprise_26oct2017Automation for the Modern Enterprise_26oct2017
Automation for the Modern Enterprise_26oct2017Claire Priester Papas
 
SplunkLive! Developer Breakout
SplunkLive! Developer BreakoutSplunkLive! Developer Breakout
SplunkLive! Developer BreakoutSplunk
 
Developing Url Shortener With Dynamic Behaviour Using AWS Lambda
Developing Url Shortener With Dynamic Behaviour Using AWS LambdaDeveloping Url Shortener With Dynamic Behaviour Using AWS Lambda
Developing Url Shortener With Dynamic Behaviour Using AWS Lambdamitesh_sharma
 
Aura Framework Overview
Aura Framework OverviewAura Framework Overview
Aura Framework Overviewrajdeep
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthroughmitesh_sharma
 
Bringing DevOps to Routing with evolved XR: an overview
Bringing DevOps to Routing with evolved XR: an overviewBringing DevOps to Routing with evolved XR: an overview
Bringing DevOps to Routing with evolved XR: an overviewCisco DevNet
 
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...Brian Grant
 
Distributed tracing 101
Distributed tracing 101Distributed tracing 101
Distributed tracing 101Itiel Shwartz
 
DEVNET-1136 Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
DEVNET-1136	Cisco ONE Enterprise Cloud Suite for Infrastructure Management.DEVNET-1136	Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
DEVNET-1136 Cisco ONE Enterprise Cloud Suite for Infrastructure Management.Cisco DevNet
 
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"Daniel Bryant
 
Introduction to Oracle Cloud Infrastructure Services
Introduction to Oracle Cloud Infrastructure ServicesIntroduction to Oracle Cloud Infrastructure Services
Introduction to Oracle Cloud Infrastructure ServicesKnoldus Inc.
 
Laying the Foundation for Ionic Platform Insights on Spark
Laying the Foundation for Ionic Platform Insights on SparkLaying the Foundation for Ionic Platform Insights on Spark
Laying the Foundation for Ionic Platform Insights on SparkIonic Security
 
Nanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeNanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeDamien Garros
 
Windows 10 IoT-Core to Azure IoT Suite
Windows 10 IoT-Core to Azure IoT SuiteWindows 10 IoT-Core to Azure IoT Suite
Windows 10 IoT-Core to Azure IoT SuiteDavid Jones
 
Microservices with kubernetes @190316
Microservices with kubernetes @190316Microservices with kubernetes @190316
Microservices with kubernetes @190316Jupil Hwang
 
Openwhisk - Colorado Meetups
Openwhisk - Colorado MeetupsOpenwhisk - Colorado Meetups
Openwhisk - Colorado MeetupsUpkar Lidder
 
DevOps for Big Data - Data 360 2014 Conference
DevOps for Big Data - Data 360 2014 ConferenceDevOps for Big Data - Data 360 2014 Conference
DevOps for Big Data - Data 360 2014 ConferenceGrid Dynamics
 

La actualidad más candente (20)

Automation for the Modern Enterprise_26oct2017
Automation for the Modern Enterprise_26oct2017Automation for the Modern Enterprise_26oct2017
Automation for the Modern Enterprise_26oct2017
 
SplunkLive! Developer Breakout
SplunkLive! Developer BreakoutSplunkLive! Developer Breakout
SplunkLive! Developer Breakout
 
Developing Url Shortener With Dynamic Behaviour Using AWS Lambda
Developing Url Shortener With Dynamic Behaviour Using AWS LambdaDeveloping Url Shortener With Dynamic Behaviour Using AWS Lambda
Developing Url Shortener With Dynamic Behaviour Using AWS Lambda
 
Aura Framework Overview
Aura Framework OverviewAura Framework Overview
Aura Framework Overview
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthrough
 
Bringing DevOps to Routing with evolved XR: an overview
Bringing DevOps to Routing with evolved XR: an overviewBringing DevOps to Routing with evolved XR: an overview
Bringing DevOps to Routing with evolved XR: an overview
 
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
 
Distributed tracing 101
Distributed tracing 101Distributed tracing 101
Distributed tracing 101
 
DevOps tools for winning agility
DevOps tools for winning agilityDevOps tools for winning agility
DevOps tools for winning agility
 
Testing at Stream-Scale
Testing at Stream-ScaleTesting at Stream-Scale
Testing at Stream-Scale
 
DEVNET-1136 Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
DEVNET-1136	Cisco ONE Enterprise Cloud Suite for Infrastructure Management.DEVNET-1136	Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
DEVNET-1136 Cisco ONE Enterprise Cloud Suite for Infrastructure Management.
 
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
 
Introduction to Oracle Cloud Infrastructure Services
Introduction to Oracle Cloud Infrastructure ServicesIntroduction to Oracle Cloud Infrastructure Services
Introduction to Oracle Cloud Infrastructure Services
 
Laying the Foundation for Ionic Platform Insights on Spark
Laying the Foundation for Ionic Platform Insights on SparkLaying the Foundation for Ionic Platform Insights on Spark
Laying the Foundation for Ionic Platform Insights on Spark
 
Nanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeNanog75, Network Device Property as Code
Nanog75, Network Device Property as Code
 
Windows 10 IoT-Core to Azure IoT Suite
Windows 10 IoT-Core to Azure IoT SuiteWindows 10 IoT-Core to Azure IoT Suite
Windows 10 IoT-Core to Azure IoT Suite
 
Microservices with kubernetes @190316
Microservices with kubernetes @190316Microservices with kubernetes @190316
Microservices with kubernetes @190316
 
Openwhisk - Colorado Meetups
Openwhisk - Colorado MeetupsOpenwhisk - Colorado Meetups
Openwhisk - Colorado Meetups
 
DevOps for Big Data - Data 360 2014 Conference
DevOps for Big Data - Data 360 2014 ConferenceDevOps for Big Data - Data 360 2014 Conference
DevOps for Big Data - Data 360 2014 Conference
 
Music streams
Music streamsMusic streams
Music streams
 

Similar a Splunk Developer Platform

SplunkLive London 2014 Developer Presentation
SplunkLive London 2014  Developer PresentationSplunkLive London 2014  Developer Presentation
SplunkLive London 2014 Developer PresentationDamien Dallimore
 
December 2013 HUG: Hunk - Splunk over Hadoop
December 2013 HUG: Hunk - Splunk over HadoopDecember 2013 HUG: Hunk - Splunk over Hadoop
December 2013 HUG: Hunk - Splunk over HadoopYahoo Developer Network
 
A Lap Around Developer Awesomeness in Splunk 6.3
A Lap Around Developer Awesomeness in Splunk 6.3A Lap Around Developer Awesomeness in Splunk 6.3
A Lap Around Developer Awesomeness in Splunk 6.3Glenn Block
 
Using Google App Engine Python
Using Google App Engine PythonUsing Google App Engine Python
Using Google App Engine PythonAkshay Mathur
 
SplunkLive! Introduction to the Splunk Developer Platform
SplunkLive! Introduction to the Splunk Developer PlatformSplunkLive! Introduction to the Splunk Developer Platform
SplunkLive! Introduction to the Splunk Developer PlatformSplunk
 
Getting Started with Splunk Enterprise Hands-On
Getting Started with Splunk Enterprise Hands-OnGetting Started with Splunk Enterprise Hands-On
Getting Started with Splunk Enterprise Hands-OnSplunk
 
Getting Started with Splunk Breakout Session
Getting Started with Splunk Breakout SessionGetting Started with Splunk Breakout Session
Getting Started with Splunk Breakout SessionSplunk
 
Splunk in Nordstrom: IT Operations
Splunk in Nordstrom: IT OperationsSplunk in Nordstrom: IT Operations
Splunk in Nordstrom: IT OperationsTimur Bagirov
 
Splunk for Developers
Splunk for DevelopersSplunk for Developers
Splunk for DevelopersSplunk
 
Getting Started with Innoslate
Getting Started with InnoslateGetting Started with Innoslate
Getting Started with InnoslateElizabeth Steiner
 
Splunk for Developers
Splunk for DevelopersSplunk for Developers
Splunk for DevelopersSplunk
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and SecurityKelwin Yang
 
Splunk for Developers Breakout Session
Splunk for Developers Breakout SessionSplunk for Developers Breakout Session
Splunk for Developers Breakout SessionSplunk
 
Splunk for Developers
Splunk for DevelopersSplunk for Developers
Splunk for DevelopersSplunk
 
Top 10 dev ops tools (1)
Top 10 dev ops tools (1)Top 10 dev ops tools (1)
Top 10 dev ops tools (1)yalini97
 
Introducing LucidWorks App for Splunk Enterprise webinar
Introducing LucidWorks App for Splunk Enterprise webinarIntroducing LucidWorks App for Splunk Enterprise webinar
Introducing LucidWorks App for Splunk Enterprise webinarLucidworks (Archived)
 
Ml based detection of users anomaly activities (20th OWASP Night Tokyo, English)
Ml based detection of users anomaly activities (20th OWASP Night Tokyo, English)Ml based detection of users anomaly activities (20th OWASP Night Tokyo, English)
Ml based detection of users anomaly activities (20th OWASP Night Tokyo, English)Yury Leonychev
 
Getting Started with Splunk Enterprise
Getting Started with Splunk EnterpriseGetting Started with Splunk Enterprise
Getting Started with Splunk EnterpriseSplunk
 

Similar a Splunk Developer Platform (20)

SplunkLive London 2014 Developer Presentation
SplunkLive London 2014  Developer PresentationSplunkLive London 2014  Developer Presentation
SplunkLive London 2014 Developer Presentation
 
December 2013 HUG: Hunk - Splunk over Hadoop
December 2013 HUG: Hunk - Splunk over HadoopDecember 2013 HUG: Hunk - Splunk over Hadoop
December 2013 HUG: Hunk - Splunk over Hadoop
 
A Lap Around Developer Awesomeness in Splunk 6.3
A Lap Around Developer Awesomeness in Splunk 6.3A Lap Around Developer Awesomeness in Splunk 6.3
A Lap Around Developer Awesomeness in Splunk 6.3
 
DevOps and Splunk
DevOps and SplunkDevOps and Splunk
DevOps and Splunk
 
Using Google App Engine Python
Using Google App Engine PythonUsing Google App Engine Python
Using Google App Engine Python
 
SplunkLive! Introduction to the Splunk Developer Platform
SplunkLive! Introduction to the Splunk Developer PlatformSplunkLive! Introduction to the Splunk Developer Platform
SplunkLive! Introduction to the Splunk Developer Platform
 
Getting Started with Splunk Enterprise Hands-On
Getting Started with Splunk Enterprise Hands-OnGetting Started with Splunk Enterprise Hands-On
Getting Started with Splunk Enterprise Hands-On
 
Getting Started with Splunk Breakout Session
Getting Started with Splunk Breakout SessionGetting Started with Splunk Breakout Session
Getting Started with Splunk Breakout Session
 
Splunk in Nordstrom: IT Operations
Splunk in Nordstrom: IT OperationsSplunk in Nordstrom: IT Operations
Splunk in Nordstrom: IT Operations
 
Splunk for Developers
Splunk for DevelopersSplunk for Developers
Splunk for Developers
 
Getting Started with Innoslate
Getting Started with InnoslateGetting Started with Innoslate
Getting Started with Innoslate
 
Splunk for Developers
Splunk for DevelopersSplunk for Developers
Splunk for Developers
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and Security
 
Splunk for Developers Breakout Session
Splunk for Developers Breakout SessionSplunk for Developers Breakout Session
Splunk for Developers Breakout Session
 
Splunk for Developers
Splunk for DevelopersSplunk for Developers
Splunk for Developers
 
Top 10 dev ops tools (1)
Top 10 dev ops tools (1)Top 10 dev ops tools (1)
Top 10 dev ops tools (1)
 
Introducing LucidWorks App for Splunk Enterprise webinar
Introducing LucidWorks App for Splunk Enterprise webinarIntroducing LucidWorks App for Splunk Enterprise webinar
Introducing LucidWorks App for Splunk Enterprise webinar
 
Revue des annonces WWDC2015
Revue des annonces WWDC2015Revue des annonces WWDC2015
Revue des annonces WWDC2015
 
Ml based detection of users anomaly activities (20th OWASP Night Tokyo, English)
Ml based detection of users anomaly activities (20th OWASP Night Tokyo, English)Ml based detection of users anomaly activities (20th OWASP Night Tokyo, English)
Ml based detection of users anomaly activities (20th OWASP Night Tokyo, English)
 
Getting Started with Splunk Enterprise
Getting Started with Splunk EnterpriseGetting Started with Splunk Enterprise
Getting Started with Splunk Enterprise
 

Más de Damien Dallimore

Splunk Conf 2014 - Splunking the Java Virtual Machine
Splunk Conf 2014 - Splunking the Java Virtual MachineSplunk Conf 2014 - Splunking the Java Virtual Machine
Splunk Conf 2014 - Splunking the Java Virtual MachineDamien Dallimore
 
Splunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the messageSplunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the messageDamien Dallimore
 
SpringOne2GX 2014 Splunk Presentation
SpringOne2GX 2014 Splunk PresentationSpringOne2GX 2014 Splunk Presentation
SpringOne2GX 2014 Splunk PresentationDamien Dallimore
 
Splunk as a_big_data_platform_for_developers_spring_one2gx
Splunk as a_big_data_platform_for_developers_spring_one2gxSplunk as a_big_data_platform_for_developers_spring_one2gx
Splunk as a_big_data_platform_for_developers_spring_one2gxDamien Dallimore
 
Splunking the JVM (Java Virtual Machine)
Splunking the JVM (Java Virtual Machine)Splunking the JVM (Java Virtual Machine)
Splunking the JVM (Java Virtual Machine)Damien Dallimore
 

Más de Damien Dallimore (9)

Splunk Conf 2014 - Splunking the Java Virtual Machine
Splunk Conf 2014 - Splunking the Java Virtual MachineSplunk Conf 2014 - Splunking the Java Virtual Machine
Splunk Conf 2014 - Splunking the Java Virtual Machine
 
Splunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the messageSplunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the message
 
SpringOne2GX 2014 Splunk Presentation
SpringOne2GX 2014 Splunk PresentationSpringOne2GX 2014 Splunk Presentation
SpringOne2GX 2014 Splunk Presentation
 
A Brief History Of Data
A Brief History Of DataA Brief History Of Data
A Brief History Of Data
 
Splunking the JVM
Splunking the JVMSplunking the JVM
Splunking the JVM
 
Splunk for JMX
Splunk for JMXSplunk for JMX
Splunk for JMX
 
Splunk Java Agent
Splunk Java AgentSplunk Java Agent
Splunk Java Agent
 
Splunk as a_big_data_platform_for_developers_spring_one2gx
Splunk as a_big_data_platform_for_developers_spring_one2gxSplunk as a_big_data_platform_for_developers_spring_one2gx
Splunk as a_big_data_platform_for_developers_spring_one2gx
 
Splunking the JVM (Java Virtual Machine)
Splunking the JVM (Java Virtual Machine)Splunking the JVM (Java Virtual Machine)
Splunking the JVM (Java Virtual Machine)
 

Último

Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 

Último (20)

Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 

Splunk Developer Platform

  • 1. Splunk Developer Platform Damien Dallimore Developer Evangelist
  • 2. Copyright©2013,SplunkInc. Splunk & Developers 2 REST API Custom/Existin g Applications SDKs Search, chart and graph Save and schedule searches as alerts Export search results Manage inputs and indexes Add & remove users and roles SplunkUI (Splunk Apps) Machine Data Engine
  • 3. Copyright©2013,SplunkInc. The Splunk REST API 3 • Exposes an API method for every feature in the product – Whatever you can do in the UI – you can do through the API – Run searches – Manage Splunk configurations • API is RESTful – Endpoints are served by Splunkd – Requestsare GET, POST, and DELETE HTTP methods – Responses are Atom XML Feeds or JSON – Versioning Support – Search results can be output in CSV/JSON/XML/Raw – Authentication is token based
  • 4. Copyright©2013,SplunkInc. Developer Platform 4 • We want to make it as easy as possible for developers to build Big Data apps and custom integrations on top of the Splunk platform • Several different language offerings, Software Development Kits (SDKs) • Javascript, Java, Python, PHP, C#, Ruby • Our SDKs make it easier to use the REST API • All Splunk functionality is accessible via our SDKs • Get Data into Splunk • Execute Splunk Searches, get data out of Splunk • Manage Splunk • Customized User Interfaces
  • 5. Copyright©2013,SplunkInc. Top 3 Developer Takeaways • Every developer can use Splunk to accelerate dev & test and gain application intelligence • The developer platform lets customers customize and extend the power of Splunk • Splunk lets developers build big data apps with the skills they already have
  • 6. Copyright©2013,SplunkInc. Takeaway 1: Use Splunk to accelerate dev & test 6 • Splunk frees you from upfront database design for analytics • late binding schema • Developers and QA/test engineers don’t have to ask IT/Ops to get logs off machines • Role base access to all data within one console without having to log into production systems • All events are indexed and accessible in real-time in one place. • Ad-Hoc real-time monitoring and historical investigation searchable from one place • Correlations and insights across multiple tiers. • Splunk lets you find issues quickly, so you can fix issues quickly • Integrate Splunk search results into testing assertions
  • 7. Copyright©2013,SplunkInc. Takeaway 2: Customize and extend Splunk 7 Integrate data from Splunk into existing apps and systems Build custom line-of- business apps powered by Splunk Deliver Operational Intelligence to marketing, sales, customer service and other divisions beyond IT in the systems and apps that make sense to them. REST API & SDKs
  • 8. Copyright©2013,SplunkInc. Takeaway 3: Splunk lets developers build big data apps with the skills they already have 8 • Developers can use the languages and frameworks they know and love – like Python, JavaScript, Java and PHP. • No need to write MapReduce jobs, learn R or be some kind of scientist to build apps that use Big Data – be a developer! Using the Python SDK to deliver customers real- time security intelligence into custom dashboards Splunks 7 million API calls per day and exposes Splunk data to customers in their customer-facing web app via REST API
  • 9. Copyright©2013,SplunkInc. Why choose to develop on Splunk ? 9 • Splunk is not agnostic of its underlying data source , MapR algorithm optimized to Splunk index files • Real time vs Batch Jobs • Optimal for time series based data • End to End Integrated Big Data Solution • Fine grained protection of access and data using role based permissions • Data retention and aging controls • Users can submit “Map Reduce” jobs without needing to know how to code a MapR job • Get the best of many worlds ie: Splunk Hadoop Connect • Splunk integrates easily with other systems, developers can then just focus on developing against 1 single platform
  • 11. Copyright©2013,SplunkInc. Visualizing Splunk with the SDKs 11 • Splunkweb has rich, but sometimes limited, visualization options • You can use the SDKs to extract data from Splunk using a search, and visualize it in an entirely custom manner • Using the Javascript SDK you can integrate with third party charting librarys like Google Charts, Rickshaw, D3,three.js etc..
  • 12. Copyright©2013,SplunkInc. Development Approaches 12 • Custom Advanced XML Modules • Incorporate into Views in SplunkWeb Apps • Share on Splunkbase or reuse internally • Use our new “Application Framework” (in preview mode currently) • Use our Python and Javascript SDK’s • Leverage your skills with other JS librarys (Backbone, JQuery) • Leverage the power of Django • Shareable UI components • Simple XML parser • Code your own standalone application • Use any of our SDKs to build your own solution and UI (web based, fat, mobile)
  • 17. Copyright©2013,SplunkInc. My Guiding Viz Principle 17 The visualization must be simple and intuitive to understand and derive meaning from at a glance. Cool viz , but what are you telling me ?
  • 18. SDK Code Examples Splunk SDK for Java
  • 19. Copyright©2013,SplunkInc. Get the Java SDK 19 • Open sourced under the Apache v2.0 license • Clone from Github : git clone https://github.com/splunk/splunk-sdk-java.git • Project levelsupport for Eclipse and IntellijIDE’s • Pre-requisites • JRE6+ • Ant , Maven coming • Splunk installed • Loadsof code examples • Project examplesfolder • Unit Tests • http://dev.splunk.com • http://gist.github.com/damiendallimore • Comprehensivecoverageof the REST API • Tutorialvideos availableat http://dev.splunk.com
  • 20. Copyright©2013,SplunkInc. Java SDK Class Model 20 Service Resource ResourceCollection Entity EntityCollection Application Index HTTPService Input InputCollection SavedSearchCollection • Collections use a common mechanism to create and remove entities • Entities use a common mechanism to retrieve and update property values, and access entity metadata • Service is a wrapper that facilitates access to all Splunk REST endpoints
  • 21. Copyright©2013,SplunkInc. Key Java SDK use cases 21 • Connect and Authenticate • Manage • Input Events • Search
  • 22. Copyright©2013,SplunkInc. Connect and Authenticate 22 public static Service connectAndLoginToSplunkExample() { Map<String, Object> connectionArgs = new HashMap<String, Object>(); connectionArgs.put("host", ”somehost"); connectionArgs.put("username", ”spring"); connectionArgs.put("password", ”integration"); connectionArgs.put("port", 8089); connectionArgs.put("scheme", "https"); // will login and save the session key which gets put in the HTTP Authorization header Service splunkService = Service.connect(connectionArgs); return splunkService; }
  • 23. Copyright©2013,SplunkInc. Manage 23 public static void getServerInfoExample() { Service splunkService = connectAndLoginToSplunkExample(); ServiceInfo info = splunkService.getInfo(); System.out.println("Info:"); for (String key : info.keySet()) System.out.println(" " + key + ": " + info.get(key)); Entity settings = splunkService.getSettings(); System.out.println("nSettings:"); for (String key : settings.keySet()) System.out.println(" " + key + ": " + settings.get(key)); }
  • 24. Copyright©2013,SplunkInc. Input Events 24 public static void logEventToSplunkExample() { Service splunkService = connectAndLoginToSplunkExample(); // Get a Receiver object Receiver receiver = splunkService.getReceiver(); // Set the sourcetype Args logArgs = new Args(); logArgs.put("source", ”http-rest"); logArgs.put("sourcetype", ”spring-example"); // Log an event into the spring index receiver.log(”spring", logArgs, ”SpringOne 2GX rocks"); } • Other Input transports • HTTP REST Streaming • Raw TCP Oneshot & Streaming • Raw UDP & Syslog
  • 25. Copyright©2013,SplunkInc. Semantic Logging Log anything that can add value when aggregated, charted or further analyzed Example Bogus Pseudo-Code: void submitPurchase(purchaseId) { log.info("action=submitPurchaseStart, purchaseId=%d", purchaseId) //these calls throw an exception on error submitToCreditCard(...) generateInvoice(...) generateFullfillmentOrder(...) log.info("action=submitPurchaseCompleted, purchaseId=%d", purchaseId) } • Create Human Readable Events • Clearly Timestamp Events • Use Key-Value Pairs (JSON Logging) • Separate Multi-Value Events • Log Unique Identifiers
  • 26. Copyright©2013,SplunkInc. Search 26 • Search query • a set of commands and functions you use to retrieve events from an index or a real-time stream , "search index=spring error OR exception | head 10” • Saved search • a search query that has been saved to be used again and can be set up to run on a regular schedule • Search job • an instance of a completed or still-running search operation.Using a search ID you can access the results of the search when they become available. Job results are saved for a period of time on the server and can be retrieved • Search Modes • Normal : asynchronous , poll job for status and results • Realtime : same as normal, but stream is kept open a results streamed in realtime • Blocking : synchronous , a job handle is returned when search is completed • Oneshot : synchronous , no job handle is returned, results are streamed • Export : synchronous, not a search per say, doesn’t return a job handle, results are streamed oldest to newest
  • 27. Copyright©2013,SplunkInc. Blocking Searches (Oneshot) 27 public static void simpleSearchExample() { Service splunkService = connectAndLoginToSplunkExample(); String searchQuery = "search error OR exception| head 10"; Args queryArgs = new Args(); queryArgs.put("earliest_time", "-3d@d"); queryArgs.put("latest_time", "-1d@d"); // perform the search , blocks here InputStream stream = splunkService.search(searchQuery, queryArgs); processInputStream(stream); }
  • 28. Copyright©2013,SplunkInc. Blocking Searches (Export) 28 public static void exportSearchExample() { Service splunkService = connectAndLoginToSplunkExample(); String searchQuery = "search error OR exception | head 10"; Args queryArgs = new Args(); queryArgs.put("earliest_time", "-1d@d"); queryArgs.put("latest_time", "now"); // perform the export , blocks here InputStream stream = splunkService.export(searchQuery, queryArgs); processInputStream(stream); }
  • 29. Copyright©2013,SplunkInc. Non Blocking Search 29 public static void searchJobExample() { Service splunkService = connectAndLoginToSplunkExample(); String outputMode = "csv";// xml,json,csv // submit the job Job job = splunkService.getJobs().create("search index=spring error OR fatal | head 10"); while (!job.isDone()) { try {Thread.sleep(500);} catch (Exception e) {} } Args outputArgs = new Args(); outputArgs.put("output_mode", outputMode); InputStream stream = job.getResults(outputArgs); processInputStream(stream, outputMode); // uses xml stream, opencsv and gson }
  • 30. Copyright©2013,SplunkInc. Realtime Search 30 public static void realTimeSearchExample() { Service splunkService = connectAndLoginToSplunkExample(); Args queryArgs = new Args(); queryArgs.put("earliest_time", "rt-5m"); queryArgs.put("latest_time", "rt"); // submit the job Job job = splunkService.getJobs().create("search index=spring exception OR error”, queryArgs); … }
  • 31. Copyright©2013,SplunkInc. Alternate JVM Languages 31 Scala Groovy Clojure Javascript(Rhino) JRuby PHP(Quercus) Ceylon Kotlin Jython We don’t need SDK’s for these languages , we can just use the Java SDK !
  • 32. Copyright©2013,SplunkInc. Groovy 32 class SplunkJavaSDKWrapper { static main(args) { //connect and login def connectionParameters = [host:”somehost",username:"spring",password:"integration"] Service service = Service.connect(connectionParameters) //get Splunk Server info ServiceInfo info = service.getInfo() def splunkInfo = [:] for (key in info.keySet()) splunkInfo.put(key,info.get(key)) printSplunkInfo(splunkInfo) } static printSplunkInfo(splunkInfo) { println "Info” splunkInfo.each { key, value ->println key + " : " + value} } }
  • 33. Copyright©2013,SplunkInc. Scala 33 importcom.splunk.Service._ importscala.collection.mutable.HashMap importscala.collection.JavaConversions._ objectSplunkJavaSDKWrapper{ def main(args:Array[String]) = { //connectand login valconnectionArgs= HashMap[String,Object]("host"->”somehost”,"username"->”me”,"password"->”foo") valservice= connect(connectionArgs) //get SplunkServerinfo valinfo= service.getInfo // Scala/Javaconversion valjavaSet= info.keySet valscalaSet= javaSet.toSet //print out SplunkServerinfo for (key <- scalaSet) println(key+ ":"+ info.get(key)) } }
  • 34. Copyright©2013,SplunkInc. Contact me 34 Email : ddallimore@splunk.com Twitter : @damiendallimore Skype : damien.dallimore Github : damiendallimore Splunkbase : damiend Slideshare : http://www.slideshare.net/damiendallimore Blogs : http://blogs.splunk.com/dev Web : http://dev.splunk.com

Notas del editor

  1. UsingSplunk on development and testing to improve application quality and time-to-release
  2. Developers can use the Splunk SDKs to: Run real-time searches and retrieve Splunk data from line-of-business systems like Customer Service applications Integrate data and visualizations (charts, tables) from Splunk into BI tools and reporting dashboardsBuild mobile applications with real-time KPI dashboards and alerts powered by Splunk Log directly to Splunk from remote devices and applications via TCP, UDP and HTTPBuild customer-facing dashboards in your applications powered by user-specific data in Splunk Manage a Splunk instance, including adding and removing users as well as creating data inputs from an application outside of SplunkProgrammatically extract data from Splunk for long-term data warehousing
  3. Ohio-based Security MSP Hurricane Labs delivers real-time security intelligence to customers using the Splunk SDK for Python. Hurricane Labs deliver’s relevant security-related data from Splunk to their customers via custom dashboards embedded in their website.San Francisco-based startup Socialize allows mobile developers to instantly add social features to their apps. More than just ratings and comments, the Socialize platform encourages mobile app users to take “social actions” within the app to drive re-engagement, retention and distribution. These “social actions” are measured, analyzed and leveraged for subsequent re-actions that increase activity and engagement in mobile apps.Socialize leverages Splunk for MapReduce and Big Data analysis. Mobile apps using Socialize create large amounts of data, averaging over 7 million API requests per day and one million actions per month. Building on the Splunk REST API to integrate at the application level for business intelligence, reporting and alerting, Socialize exposes Splunk data to its customers through highly customized dashboards.
  4. Example of a silicon valley startup , tshark , mac , 3 weeks coding custom programs , I did this in 30 mins