SlideShare a Scribd company logo
Copyright © 2016 Splunk Inc.
Getting Data In by
Example
Nimish Doshi
Principal Systems Engineer
Assumption
Install Splunk Enterprise
● This presentation assumes that you have installed Splunk somewhere,
have access to Splunk Enterprise, and have access to the data that is
being sent.
2
Agenda
Files and Directories
Network Inputs
Scripted Inputs
HTTP Event Collector
Advance Input Topics
3
Universal Forwarder
● Download the Splunk UF for your platform and install it where your files
reside.
In directory or folder $SPLUNK_HOME/etc/system/local/, create
or modify a file called outputs.conf (Create local, if not present)
outputs.conf will send data to the place where Splunk Enterprise
resides.
Know your Splunk Enterprise’s IP or Domain Name and listening port.
Restart the forwarder after changing outputs.conf
4
Software to Send Data
Example Outputs.conf
File that controls where data is sent
#Default Place Where Data is sent. It’s just a name used in the next stanza
[tcpout]
defaultGroup=my_indexers
# Notice (commas for more) name of the server and listening port
[tcpout:my_indexers]
server=mysplunk_indexer1:9997
# Any optional properties for the indexer. Leave blank for now.
[tcpout-server://mysplunk_indexer1:9997]
5
Set up Indexer to Receive Data
Under Settings->Forwarding and Receiving->Receive Data --Add New
6
Inputs.conf
Place file in same place as outputs.conf
● This file controls what data is monitored or collected by the forwarder
● Opt In: Only data that is monitored will be sent to Splunk Indexers.
● If you make changes to the file manually, restart the forwarder
7
Sample Inputs.conf to monitor files
Always put in a sourcetype (and optional index)!!!!!
[monitor:///opt/logs/webfiles*] # files starting with webfiles
sourcetype=access_combined
[monitor:///apache/*.log] # files ending with.log in apache
sourcetype=access_combined
[monitor://var/.../log(a|b).log] # files loga.log or logb.log
sourcetype=syslog
index=IT
8
Sample Inputs.conf to blacklist whitelist files
Always put in a sourcetype!!!!!
[monitor:///mnt/logs] # ignore files ending with .txt or .gz
blacklist = .(?:txt|gz)$ # blacklist blocks
sourcetype=my_app
[monitor:///apache] # files stdout.log and web.log in apache
whitelist = stdout.log$|web.log$ # whitelist allows
sourcetype=access_combined
# For better performance, use … or * followed by regex over whitelist and blacklist
9
Sample Inputs.conf for Windows Events
inputs.conf on a Windows Machine
# Windows platform specific input processor.
[WinEventLog://Application]
disabled = 0 # disabled=false and disabled=0 are the same instruction: Enable
[WinEventLog://Security]
disabled = 0
[WinEventLog://System]
disabled = 0
10
Line breaking
Default line breaker for events is a newline (r|n)
● How do you tell Splunk to break multi-line events correctly?
● Create or modify a props.conf file on the machine indexing the
data in either the app’s local directory or
$SPLUNK_HOME/etc/system/local.
● Contents of props.conf
[name of your sourcetype] # Use either of the two below
BREAK_ONLY_BEFORE = regular expression indicating end of your event
LINE_BREAKER=(matching group regex indicting end of event)
● LINE_BREAKER performs better than BREAK_ONLY_BEFORE
11
Line Breaking Example
Example props.conf and channel event data
[channel_entry]
BREAK_ONLY_BEFORE = ^channel
Sample Events
channel=documentaryfilm
<video> <id> 120206922 </id> <video>
channel=Indiefilm
<video> <id> 120206923 </id> <video>
12
Timestamp Recognizion
Normally, Splunk recognizes timestamps automatically, but…
● How do you tell Splunk to recognize custom timestamps?
● Create or modify a props.conf file on the machine indexing the data in
either the app’s local directory or $SPLUNK_HOME/etc/system/local.
● Contents of props.conf
[name of your sourcetype]
TIME_PREFEX= regular expression indicating where to find timestamp
TIME_FORMAT=*NIX <strptime-style format. See Docs online for format>
MAX_TIMESTAMP_LOOKAHEAD= number of characters to look ahead for TS
13
Timestamp Example
Example props.conf and some event data
[journal]
TIME_PREFIX = Valid_Until=
TIME_FORMAT = %b %d %H:%M:%S %Z%z %Y
Sample Events
…Valid_Until=Thu Dec 31 17:59:59 GMT-06:00 2020
14
Agenda
Files and Directories
Network Inputs
Scripted Inputs
HTTP Event Collector
Advance Input Topics
15
Network Inputs
Splunk Indexer or forwarder can listen for TCP on UDP data
● Configure your inputs.conf to listen on a port for TCP or UDP data.
● You can use Splunk Web itself to configure this on an indexer machine.
● Restart the indexer or forwarder if you modified inputs.conf directly.
16
Example UDP inputs.conf
Connectionless and prone to data loss
[udp://514]
sourcetype=cisco_asa
[udp://515]
sourcetype=pan_threat
17
Assign UDP sourcetype dynamically
All data goes through the same port
inputs.conf
[udp://514]
props.conf
[source::udp:514]
TRANSFORMS-ASA=assign_ASA
TRANSFORMS-PAN=assign_PAN
18
Use transforms.conf to assign sourcetype
Transforms.conf is in the same place as props.conf
Transforms.conf
[assign_ASA]
REGEX = ASA
FORMAT = sourcetype::cisco_ASA
DEST_KEY = MetaData:Sourcetype
[assign_PAN]
REGEX = pand+
FORMAT = sourcetype::pan_threat
DEST_KEY = MetaData:Sourcetype
19
Example TCP inputs.conf
Connection Oriented
[tcp://remote_server:9998]
sourcetype=cisco_asa
[tcp://9999] # any server can connect to send data
sourcetype=pan_threat
20
Best Practice to collect from Network
Use intermediary to collect data to files and forward the data
21
Agenda
Files and Directories
Network Inputs
Scripted Inputs
HTTP Event Collector
Advance Input Topics
22
Using Scripted Input
• Splunk’s inputs.conf file can monitor the output of any script
• Script can be written in any language executable by OS’s shell.
• Wrap the executable language in top level script, if necessary
• Each script is executed on a number of seconds interval basis
• Output of script is captured by Splunk’s indexer
• Output should be considered an Event to be be indexed
Example Inputs.conf
[script:///opt/splunk/etc/apps/scripts/bin/top.sh]
interval = 5 # run every 5 seconds
sourcetype = top # set sourcetype to top
source = top_output
Inputs.conf for calling Java program
# For Windows. Unix is the 2nd entry. weather.bat|sh are wrappers.
[script://.binweather.bat]
interval = 120
sourcetype = weather_entry
source = weather_xml
disabled = false
[script://./bin/weather.sh]
interval = 120
sourcetype = weather_entry
source = weather_xml
disabled = false
Example Inputs.conf for listener
# Unix/Linux called from Splunk App
[script://./bin/JMSReceive.sh]
interval=-1 # -1 means start once and only once
sourcetype=JMS_event
source=JMS_entry
host=virtual_linux
disabled=false
Example Inputs.conf for Windows Perf
# Collect CPU processor usage metrics on a windows machine.
# Splunk provides perfmon input.
[perfmon://Processor]
object = Processor
instances = _Total
counters = % Processor Time;% User Time
index = Perf
interval = 30
disabled = 0
Agenda
Files and Directories
Network Inputs
Scripted Inputs
HTTP Event Collector
Advance Input Topics
28
29
HEC Set Up
Set up via Splunk Web to get a Token used by developers
● Get an unique token for your developers to send events via HTTP/S
● Give token to developers. Enable the token.
● Developers log events via HTTP using a language that supports HTTP/S
● Data can go directly to an indexer machine or intermediary forwarder
● Logic should be built-in the code to handle exceptions and retries
30
Set up HEC Token
Go to Settings->Data Inputs->HTTP Event Collector and click on it.
31
Enable HEC Via Global Settings
32
Do this once
Add a new HEC Token
Name your token
33
Configure HEC Token
Give it a default index and sourcetype
34
Review Token Configuration
35
Submit Token Configuration
36
Test your token
Curl can be used to send HTTP data
● > curl -k
https://localhost:8088/services/collector/event
-H "Authorization: Splunk 65123E77-86B1-4136-
B955-E8CDD6A7D3B1" -d '{"event": "my log entry
via HEC"}’
● {"text":"Success","code":0}
● Notice the token in the Authorization:Splunk
● This event is can be sent as JSON or raw data and returns success
● http://dev.splunk.com/view/event-collector/SP-CAAAE6P
37
Search Splunk for Sample HEC Sent Data
38
Sample Java Code to send via HEC
● Run with -Djava.util.logging.config.file=/path/to/jdklogging.properties
import java.util.logging.*;
import com.splunk.logging.*;
%user_logger_name%.level = INFO
%user_logger_name%.handlers = com.splunk.logging.HttpEventCollectorLoggingHandler
# Configure the com.splunk.logging.HttpEventCollectorLoggingHandler
com.splunk.logging.HttpEventCollectorLoggingHandler.url = “https://mydomain:8088”
com.splunk.logging.HttpEventCollectorLoggingHandler.level = INFO
com.splunk.logging.HttpEventCollectorLoggingHandler.token = “65123E77-86B1-4136-B955-
E8CDD6A7D3B1”
com.splunk.logging.HttpEventCollectorLoggingHandler.disableCertificateValidation=true
logger.info("This is a test event for Logback test");
39
Agenda
Files and Directories
Network Inputs
Scripted Inputs
HTTP Event Collector
Advance Input Topics
40
Modular Input
Wrap your scripted Input into a Modular Input
● Modular input allows you to package your input as a reusable framework
● Modular Input provides validation of input and REST API access for
administration such as permission granting
● Modular inputs can be configured by your user via Splunk Web on an
indexer or new custom entries for inputs.conf
● See Splunk docs for more details
http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ModInputsIntro
41
Sample Modular Input
Github Input via Splunk Web
42
Splunk Stream
Splunk supported app to listen to network TAP or SPAN for data
● Captures wire data without the need for a forwarder on very end point
– Network must allow promiscuous read or provide certificates to decrypt
– Splunk Stream can still be placed on a machine to capture its network output
● Ingestion of payload can be controlled and filtered
● Works with a variety of protocols out of the box
● Ingests wired data into human readable JSON format automatically
● See Splunk docs for more details and download from Splunkbase.
43
Configured Stream
Sample protocol configuration
44
Thank You

More Related Content

What's hot (20)

PDF
Introduce to Terraform
Samsung Electronics
 
PDF
Beyond SQL: Speeding up Spark with DataFrames
Databricks
 
PDF
Elk devops
Ideato
 
PDF
Server monitoring using grafana and prometheus
Celine George
 
PPTX
Apache Airflow overview
NikolayGrishchenkov
 
PDF
Kafka Streams: What it is, and how to use it?
confluent
 
PPTX
Practical learnings from running thousands of Flink jobs
Flink Forward
 
PDF
Introduction To Flink
Knoldus Inc.
 
PPTX
Virtual Flink Forward 2020: A deep dive into Flink SQL - Jark Wu
Flink Forward
 
PPTX
Elk with Openstack
Arun prasath
 
PPTX
Splunk Search Optimization
Splunk
 
PDF
Intro to open source observability with grafana, prometheus, loki, and tempo(...
LibbySchulze
 
PPTX
Worst Splunk practices...and how to fix them
Splunk
 
PDF
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
Flink Forward
 
PDF
Flink and NiFi, Two Stars in the Apache Big Data Constellation
Matthew Ring
 
PDF
Orchestrating workflows Apache Airflow on GCP & AWS
Derrick Qin
 
PPTX
Elastic stack Presentation
Amr Alaa Yassen
 
PDF
Introducing the Apache Flink Kubernetes Operator
Flink Forward
 
PDF
Monitoring with prometheus
Kasper Nissen
 
PDF
Network visibility and control using industry standard sFlow telemetry
pphaal
 
Introduce to Terraform
Samsung Electronics
 
Beyond SQL: Speeding up Spark with DataFrames
Databricks
 
Elk devops
Ideato
 
Server monitoring using grafana and prometheus
Celine George
 
Apache Airflow overview
NikolayGrishchenkov
 
Kafka Streams: What it is, and how to use it?
confluent
 
Practical learnings from running thousands of Flink jobs
Flink Forward
 
Introduction To Flink
Knoldus Inc.
 
Virtual Flink Forward 2020: A deep dive into Flink SQL - Jark Wu
Flink Forward
 
Elk with Openstack
Arun prasath
 
Splunk Search Optimization
Splunk
 
Intro to open source observability with grafana, prometheus, loki, and tempo(...
LibbySchulze
 
Worst Splunk practices...and how to fix them
Splunk
 
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
Flink Forward
 
Flink and NiFi, Two Stars in the Apache Big Data Constellation
Matthew Ring
 
Orchestrating workflows Apache Airflow on GCP & AWS
Derrick Qin
 
Elastic stack Presentation
Amr Alaa Yassen
 
Introducing the Apache Flink Kubernetes Operator
Flink Forward
 
Monitoring with prometheus
Kasper Nissen
 
Network visibility and control using industry standard sFlow telemetry
pphaal
 

Viewers also liked (20)

PPTX
Art of the Possible - Innovating with Splunk
Splunk
 
PDF
SplunkSummit 2015 - HTTP Event Collector, Simplified Developer Logging
Splunk
 
PDF
Splunk conf2014 - Onboarding Data Into Splunk
Splunk
 
PDF
Kubernetes intro public - kubernetes user group 4-21-2015
reallavalamp
 
PPTX
SplunkLive! Presentation - Data Onboarding with Splunk
Splunk
 
PDF
Arc 60305 project 3 measured drawings
Arvindhan Balasingam
 
PDF
Communication Day Presentation: Kapow! #MyWay!
Bloomsburg University
 
PDF
아토큐브 동요
attocube
 
PPS
PROFISSÕES........
Lucio Borges
 
PPTX
Bullying y aceptación en la homosexualidad
Daniela Guachetá
 
PPTX
Who am I?
Leenette Fincham
 
PDF
ADMISS
Ingenero
 
PPTX
Getting Started with Splunk Breakout Session
Splunk
 
PPTX
SplunkLive! Milano 2016 - customer presentation - Unicredit
Splunk
 
PPTX
SplunkLive! Milano 2016 - customer presentation - Yoox - Net a porter
Splunk
 
PDF
Brand It MIT Launch Club
Steve Sue
 
PPTX
Decorating The World With Inkjet - IMI European Inkjet Conference November 20...
Xennia Technology
 
PDF
Machine Learning + Analytics
Splunk
 
PPTX
Taking Splunk to the Next Level - Management
Splunk
 
PDF
Building Business Service Intelligence
Splunk
 
Art of the Possible - Innovating with Splunk
Splunk
 
SplunkSummit 2015 - HTTP Event Collector, Simplified Developer Logging
Splunk
 
Splunk conf2014 - Onboarding Data Into Splunk
Splunk
 
Kubernetes intro public - kubernetes user group 4-21-2015
reallavalamp
 
SplunkLive! Presentation - Data Onboarding with Splunk
Splunk
 
Arc 60305 project 3 measured drawings
Arvindhan Balasingam
 
Communication Day Presentation: Kapow! #MyWay!
Bloomsburg University
 
아토큐브 동요
attocube
 
PROFISSÕES........
Lucio Borges
 
Bullying y aceptación en la homosexualidad
Daniela Guachetá
 
Who am I?
Leenette Fincham
 
ADMISS
Ingenero
 
Getting Started with Splunk Breakout Session
Splunk
 
SplunkLive! Milano 2016 - customer presentation - Unicredit
Splunk
 
SplunkLive! Milano 2016 - customer presentation - Yoox - Net a porter
Splunk
 
Brand It MIT Launch Club
Steve Sue
 
Decorating The World With Inkjet - IMI European Inkjet Conference November 20...
Xennia Technology
 
Machine Learning + Analytics
Splunk
 
Taking Splunk to the Next Level - Management
Splunk
 
Building Business Service Intelligence
Splunk
 
Ad

Similar to Getting Data into Splunk (20)

PPTX
Workshop splunk 6.5-saint-louis-mo
Mohamad Hassan
 
PPTX
SplunkLive! - Getting started with Splunk
Splunk
 
PDF
Machine Data 101
Splunk
 
PPTX
Machine Data 101
Splunk
 
PPTX
Machine Data 101: Turning Data Into Insight
Splunk
 
PPTX
Machine Data 101: Turning Data Into Insight
Splunk
 
PDF
Splunk workshop-Machine Data 101
Splunk
 
PPTX
Splunk live beginner training nyc
Dimitri McKay - CISSP
 
PPTX
SplunkLive! Frankfurt 2018 - Data Onboarding Overview
Splunk
 
PPTX
SplunkLive! Munich 2018: Data Onboarding Overview
Splunk
 
PPTX
Data Onboarding Breakout Session
Splunk
 
PPTX
SplunkLive Oslo/Stockholm Beginner Workshop
jenny_splunk
 
PPTX
Getting Started with Splunk Break out Session
Georg Knon
 
PPTX
Machine Data 101: Turning Data Into Insight
Splunk
 
PPTX
SplunkLive! Beginner Session
Splunk
 
PPTX
Splunk Discovery: Warsaw 2018 - Getting Data In
Splunk
 
PPTX
SplunkLive! Getting Started with Splunk Enterprise
Splunk
 
PPTX
SplunkLive! Zürich 2014 Beginner Workshop: Getting started with Splunk
Georg Knon
 
PPTX
Splunk
Megha Sahu
 
PPTX
Getting started with Splunk - Break out Session
Georg Knon
 
Workshop splunk 6.5-saint-louis-mo
Mohamad Hassan
 
SplunkLive! - Getting started with Splunk
Splunk
 
Machine Data 101
Splunk
 
Machine Data 101
Splunk
 
Machine Data 101: Turning Data Into Insight
Splunk
 
Machine Data 101: Turning Data Into Insight
Splunk
 
Splunk workshop-Machine Data 101
Splunk
 
Splunk live beginner training nyc
Dimitri McKay - CISSP
 
SplunkLive! Frankfurt 2018 - Data Onboarding Overview
Splunk
 
SplunkLive! Munich 2018: Data Onboarding Overview
Splunk
 
Data Onboarding Breakout Session
Splunk
 
SplunkLive Oslo/Stockholm Beginner Workshop
jenny_splunk
 
Getting Started with Splunk Break out Session
Georg Knon
 
Machine Data 101: Turning Data Into Insight
Splunk
 
SplunkLive! Beginner Session
Splunk
 
Splunk Discovery: Warsaw 2018 - Getting Data In
Splunk
 
SplunkLive! Getting Started with Splunk Enterprise
Splunk
 
SplunkLive! Zürich 2014 Beginner Workshop: Getting started with Splunk
Georg Knon
 
Splunk
Megha Sahu
 
Getting started with Splunk - Break out Session
Georg Knon
 
Ad

More from Splunk (20)

PDF
Splunk Leadership Forum Wien - 20.05.2025
Splunk
 
PDF
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
PDF
Building Resilience with Energy Management for the Public Sector
Splunk
 
PDF
IT-Lagebild: Observability for Resilience (SVA)
Splunk
 
PDF
Nach dem SOC-Aufbau ist vor der Automatisierung (OFD Baden-Württemberg)
Splunk
 
PDF
Monitoring einer Sicheren Inter-Netzwerk Architektur (SINA)
Splunk
 
PDF
Praktische Erfahrungen mit dem Attack Analyser (gematik)
Splunk
 
PDF
Cisco XDR & Splunk SIEM - stronger together (DATAGROUP Cyber Security)
Splunk
 
PDF
Security - Mit Sicherheit zum Erfolg (Telekom)
Splunk
 
PDF
One Cisco - Splunk Public Sector Summit Germany April 2025
Splunk
 
PDF
.conf Go 2023 - Data analysis as a routine
Splunk
 
PDF
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV
Splunk
 
PDF
.conf Go 2023 - Navegando la normativa SOX (Telefónica)
Splunk
 
PDF
.conf Go 2023 - Raiffeisen Bank International
Splunk
 
PDF
.conf Go 2023 - På liv og død Om sikkerhetsarbeid i Norsk helsenett
Splunk
 
PDF
.conf Go 2023 - Many roads lead to Rome - this was our journey (Julius Bär)
Splunk
 
PDF
.conf Go 2023 - Das passende Rezept für die digitale (Security) Revolution zu...
Splunk
 
PDF
.conf go 2023 - Cyber Resilienz – Herausforderungen und Ansatz für Energiever...
Splunk
 
PDF
.conf go 2023 - De NOC a CSIRT (Cellnex)
Splunk
 
PDF
conf go 2023 - El camino hacia la ciberseguridad (ABANCA)
Splunk
 
Splunk Leadership Forum Wien - 20.05.2025
Splunk
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Building Resilience with Energy Management for the Public Sector
Splunk
 
IT-Lagebild: Observability for Resilience (SVA)
Splunk
 
Nach dem SOC-Aufbau ist vor der Automatisierung (OFD Baden-Württemberg)
Splunk
 
Monitoring einer Sicheren Inter-Netzwerk Architektur (SINA)
Splunk
 
Praktische Erfahrungen mit dem Attack Analyser (gematik)
Splunk
 
Cisco XDR & Splunk SIEM - stronger together (DATAGROUP Cyber Security)
Splunk
 
Security - Mit Sicherheit zum Erfolg (Telekom)
Splunk
 
One Cisco - Splunk Public Sector Summit Germany April 2025
Splunk
 
.conf Go 2023 - Data analysis as a routine
Splunk
 
.conf Go 2023 - How KPN drives Customer Satisfaction on IPTV
Splunk
 
.conf Go 2023 - Navegando la normativa SOX (Telefónica)
Splunk
 
.conf Go 2023 - Raiffeisen Bank International
Splunk
 
.conf Go 2023 - På liv og død Om sikkerhetsarbeid i Norsk helsenett
Splunk
 
.conf Go 2023 - Many roads lead to Rome - this was our journey (Julius Bär)
Splunk
 
.conf Go 2023 - Das passende Rezept für die digitale (Security) Revolution zu...
Splunk
 
.conf go 2023 - Cyber Resilienz – Herausforderungen und Ansatz für Energiever...
Splunk
 
.conf go 2023 - De NOC a CSIRT (Cellnex)
Splunk
 
conf go 2023 - El camino hacia la ciberseguridad (ABANCA)
Splunk
 

Recently uploaded (20)

PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 

Getting Data into Splunk

  • 1. Copyright © 2016 Splunk Inc. Getting Data In by Example Nimish Doshi Principal Systems Engineer
  • 2. Assumption Install Splunk Enterprise ● This presentation assumes that you have installed Splunk somewhere, have access to Splunk Enterprise, and have access to the data that is being sent. 2
  • 3. Agenda Files and Directories Network Inputs Scripted Inputs HTTP Event Collector Advance Input Topics 3
  • 4. Universal Forwarder ● Download the Splunk UF for your platform and install it where your files reside. In directory or folder $SPLUNK_HOME/etc/system/local/, create or modify a file called outputs.conf (Create local, if not present) outputs.conf will send data to the place where Splunk Enterprise resides. Know your Splunk Enterprise’s IP or Domain Name and listening port. Restart the forwarder after changing outputs.conf 4 Software to Send Data
  • 5. Example Outputs.conf File that controls where data is sent #Default Place Where Data is sent. It’s just a name used in the next stanza [tcpout] defaultGroup=my_indexers # Notice (commas for more) name of the server and listening port [tcpout:my_indexers] server=mysplunk_indexer1:9997 # Any optional properties for the indexer. Leave blank for now. [tcpout-server://mysplunk_indexer1:9997] 5
  • 6. Set up Indexer to Receive Data Under Settings->Forwarding and Receiving->Receive Data --Add New 6
  • 7. Inputs.conf Place file in same place as outputs.conf ● This file controls what data is monitored or collected by the forwarder ● Opt In: Only data that is monitored will be sent to Splunk Indexers. ● If you make changes to the file manually, restart the forwarder 7
  • 8. Sample Inputs.conf to monitor files Always put in a sourcetype (and optional index)!!!!! [monitor:///opt/logs/webfiles*] # files starting with webfiles sourcetype=access_combined [monitor:///apache/*.log] # files ending with.log in apache sourcetype=access_combined [monitor://var/.../log(a|b).log] # files loga.log or logb.log sourcetype=syslog index=IT 8
  • 9. Sample Inputs.conf to blacklist whitelist files Always put in a sourcetype!!!!! [monitor:///mnt/logs] # ignore files ending with .txt or .gz blacklist = .(?:txt|gz)$ # blacklist blocks sourcetype=my_app [monitor:///apache] # files stdout.log and web.log in apache whitelist = stdout.log$|web.log$ # whitelist allows sourcetype=access_combined # For better performance, use … or * followed by regex over whitelist and blacklist 9
  • 10. Sample Inputs.conf for Windows Events inputs.conf on a Windows Machine # Windows platform specific input processor. [WinEventLog://Application] disabled = 0 # disabled=false and disabled=0 are the same instruction: Enable [WinEventLog://Security] disabled = 0 [WinEventLog://System] disabled = 0 10
  • 11. Line breaking Default line breaker for events is a newline (r|n) ● How do you tell Splunk to break multi-line events correctly? ● Create or modify a props.conf file on the machine indexing the data in either the app’s local directory or $SPLUNK_HOME/etc/system/local. ● Contents of props.conf [name of your sourcetype] # Use either of the two below BREAK_ONLY_BEFORE = regular expression indicating end of your event LINE_BREAKER=(matching group regex indicting end of event) ● LINE_BREAKER performs better than BREAK_ONLY_BEFORE 11
  • 12. Line Breaking Example Example props.conf and channel event data [channel_entry] BREAK_ONLY_BEFORE = ^channel Sample Events channel=documentaryfilm <video> <id> 120206922 </id> <video> channel=Indiefilm <video> <id> 120206923 </id> <video> 12
  • 13. Timestamp Recognizion Normally, Splunk recognizes timestamps automatically, but… ● How do you tell Splunk to recognize custom timestamps? ● Create or modify a props.conf file on the machine indexing the data in either the app’s local directory or $SPLUNK_HOME/etc/system/local. ● Contents of props.conf [name of your sourcetype] TIME_PREFEX= regular expression indicating where to find timestamp TIME_FORMAT=*NIX <strptime-style format. See Docs online for format> MAX_TIMESTAMP_LOOKAHEAD= number of characters to look ahead for TS 13
  • 14. Timestamp Example Example props.conf and some event data [journal] TIME_PREFIX = Valid_Until= TIME_FORMAT = %b %d %H:%M:%S %Z%z %Y Sample Events …Valid_Until=Thu Dec 31 17:59:59 GMT-06:00 2020 14
  • 15. Agenda Files and Directories Network Inputs Scripted Inputs HTTP Event Collector Advance Input Topics 15
  • 16. Network Inputs Splunk Indexer or forwarder can listen for TCP on UDP data ● Configure your inputs.conf to listen on a port for TCP or UDP data. ● You can use Splunk Web itself to configure this on an indexer machine. ● Restart the indexer or forwarder if you modified inputs.conf directly. 16
  • 17. Example UDP inputs.conf Connectionless and prone to data loss [udp://514] sourcetype=cisco_asa [udp://515] sourcetype=pan_threat 17
  • 18. Assign UDP sourcetype dynamically All data goes through the same port inputs.conf [udp://514] props.conf [source::udp:514] TRANSFORMS-ASA=assign_ASA TRANSFORMS-PAN=assign_PAN 18
  • 19. Use transforms.conf to assign sourcetype Transforms.conf is in the same place as props.conf Transforms.conf [assign_ASA] REGEX = ASA FORMAT = sourcetype::cisco_ASA DEST_KEY = MetaData:Sourcetype [assign_PAN] REGEX = pand+ FORMAT = sourcetype::pan_threat DEST_KEY = MetaData:Sourcetype 19
  • 20. Example TCP inputs.conf Connection Oriented [tcp://remote_server:9998] sourcetype=cisco_asa [tcp://9999] # any server can connect to send data sourcetype=pan_threat 20
  • 21. Best Practice to collect from Network Use intermediary to collect data to files and forward the data 21
  • 22. Agenda Files and Directories Network Inputs Scripted Inputs HTTP Event Collector Advance Input Topics 22
  • 23. Using Scripted Input • Splunk’s inputs.conf file can monitor the output of any script • Script can be written in any language executable by OS’s shell. • Wrap the executable language in top level script, if necessary • Each script is executed on a number of seconds interval basis • Output of script is captured by Splunk’s indexer • Output should be considered an Event to be be indexed
  • 24. Example Inputs.conf [script:///opt/splunk/etc/apps/scripts/bin/top.sh] interval = 5 # run every 5 seconds sourcetype = top # set sourcetype to top source = top_output
  • 25. Inputs.conf for calling Java program # For Windows. Unix is the 2nd entry. weather.bat|sh are wrappers. [script://.binweather.bat] interval = 120 sourcetype = weather_entry source = weather_xml disabled = false [script://./bin/weather.sh] interval = 120 sourcetype = weather_entry source = weather_xml disabled = false
  • 26. Example Inputs.conf for listener # Unix/Linux called from Splunk App [script://./bin/JMSReceive.sh] interval=-1 # -1 means start once and only once sourcetype=JMS_event source=JMS_entry host=virtual_linux disabled=false
  • 27. Example Inputs.conf for Windows Perf # Collect CPU processor usage metrics on a windows machine. # Splunk provides perfmon input. [perfmon://Processor] object = Processor instances = _Total counters = % Processor Time;% User Time index = Perf interval = 30 disabled = 0
  • 28. Agenda Files and Directories Network Inputs Scripted Inputs HTTP Event Collector Advance Input Topics 28
  • 29. 29
  • 30. HEC Set Up Set up via Splunk Web to get a Token used by developers ● Get an unique token for your developers to send events via HTTP/S ● Give token to developers. Enable the token. ● Developers log events via HTTP using a language that supports HTTP/S ● Data can go directly to an indexer machine or intermediary forwarder ● Logic should be built-in the code to handle exceptions and retries 30
  • 31. Set up HEC Token Go to Settings->Data Inputs->HTTP Event Collector and click on it. 31
  • 32. Enable HEC Via Global Settings 32 Do this once
  • 33. Add a new HEC Token Name your token 33
  • 34. Configure HEC Token Give it a default index and sourcetype 34
  • 37. Test your token Curl can be used to send HTTP data ● > curl -k https://localhost:8088/services/collector/event -H "Authorization: Splunk 65123E77-86B1-4136- B955-E8CDD6A7D3B1" -d '{"event": "my log entry via HEC"}’ ● {"text":"Success","code":0} ● Notice the token in the Authorization:Splunk ● This event is can be sent as JSON or raw data and returns success ● http://dev.splunk.com/view/event-collector/SP-CAAAE6P 37
  • 38. Search Splunk for Sample HEC Sent Data 38
  • 39. Sample Java Code to send via HEC ● Run with -Djava.util.logging.config.file=/path/to/jdklogging.properties import java.util.logging.*; import com.splunk.logging.*; %user_logger_name%.level = INFO %user_logger_name%.handlers = com.splunk.logging.HttpEventCollectorLoggingHandler # Configure the com.splunk.logging.HttpEventCollectorLoggingHandler com.splunk.logging.HttpEventCollectorLoggingHandler.url = “https://mydomain:8088” com.splunk.logging.HttpEventCollectorLoggingHandler.level = INFO com.splunk.logging.HttpEventCollectorLoggingHandler.token = “65123E77-86B1-4136-B955- E8CDD6A7D3B1” com.splunk.logging.HttpEventCollectorLoggingHandler.disableCertificateValidation=true logger.info("This is a test event for Logback test"); 39
  • 40. Agenda Files and Directories Network Inputs Scripted Inputs HTTP Event Collector Advance Input Topics 40
  • 41. Modular Input Wrap your scripted Input into a Modular Input ● Modular input allows you to package your input as a reusable framework ● Modular Input provides validation of input and REST API access for administration such as permission granting ● Modular inputs can be configured by your user via Splunk Web on an indexer or new custom entries for inputs.conf ● See Splunk docs for more details http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ModInputsIntro 41
  • 42. Sample Modular Input Github Input via Splunk Web 42
  • 43. Splunk Stream Splunk supported app to listen to network TAP or SPAN for data ● Captures wire data without the need for a forwarder on very end point – Network must allow promiscuous read or provide certificates to decrypt – Splunk Stream can still be placed on a machine to capture its network output ● Ingestion of payload can be controlled and filtered ● Works with a variety of protocols out of the box ● Ingests wired data into human readable JSON format automatically ● See Splunk docs for more details and download from Splunkbase. 43