Splunk 6.0.3 Forwarding
Splunk 6.0.3 Forwarding
3
Forwarding Data
Generated: 4/22/2014 8:13 am
Configure forwarding........................................................................................12
Set up forwarding and receiving..............................................................12
Compatibility between forwarders and indexers.....................................14
Enable a receiver....................................................................................15
Consolidate data from multiple machines...............................................19
Set up load balancing..............................................................................21
i
Table of Contents
Heavy and light forwarders.............................................................................114
Deploy a heavy forwarder.....................................................................114
Deploy a light forwarder........................................................................117
Heavy and light forwarder capabilities..................................................120
Troubleshoot forwarding................................................................................123
Troubleshoot forwarder/receiver connection.........................................123
ii
Overview
You can forward data from one Splunk Enterprise instance to another Splunk
Enterprise instance or even to a non-Splunk system. The Splunk Enterprise
instance that performs the forwarding is typically a smaller footprint version of
Splunk Enterprise, called a forwarder.
A Splunk Enterprise instance that receives data from one or more forwarders is
called a receiver. The receiver is usually a Splunk Enterprise indexer, but can
also be another forwarder, as described here.
This diagram shows three forwarders sending data to a single receiver (an
indexer), which then indexes the data and makes it available for searching:
Forwarders represent a much more robust solution for data forwarding than raw
network feeds, with their capabilities for:
1
• Configurable buffering
• Data compression
• SSL security
• Use of any available network ports
The forwarding and receiving capability makes possible all sorts of interesting
Splunk Enterprise topologies to handle functions like data consolidation, load
balancing, and data routing. For more information on the types of deployment
topologies that you can create with forwarders, see "Forwarder deployment
topologies".
Types of forwarders
There are three types of forwarders:
Note: The light forwarder has been deprecated in Splunk Enterprise version 6.0.
For a list of all deprecated features, see the topic "Deprecated features" in the
Release Notes.
In nearly all respects, the universal forwarder represents the best tool for
forwarding data to indexers. Its main limitation is that it forwards only unparsed
data, as described later in this topic. Therefore, you cannot use it to route data
based on event contents. For that, you must use a heavy forwarder. You also
cannot index data locally on a universal forwarder; only a heavy forwarder can
index and forward.
2
The universal forwarder
The universal forwarder's sole purpose is to forward data. Unlike a full Splunk
Enterprise instance, you cannot use the universal forwarder to index or search
data. To achieve higher performance and a lighter footprint, it has several
limitations:
While the universal forwarder is generally the preferred way to forward data, you
might have reason (legacy-based or otherwise) to use heavy or light forwarders
as well. Unlike the universal forwarder, which is an entirely separate, streamlined
executable, both heavy and light forwarders are actually full Splunk Enterprise
instances with certain features disabled. Heavy and light forwarders differ in
capability and the corresponding size of their footprints.
3
One key advantage of the heavy forwarder is that it can index data locally, as
well as forward data to another Splunk Enterprise instance. You must turn this
capability on; it's disabled by default. See "Configure forwarders with
outputs.conf" in this manual for details.
A light forwarder has a smaller footprint with much more limited functionality. It
forwards only unparsed data. Starting with 4.2, it has been superseded by the
universal forwarder, which provides very similar functionality in a smaller
footprint. The light forwarder continues to be available mainly to meet any legacy
needs. We recommend that you always use the universal forwarder to forward
unparsed data. When you install a universal forwarder, the installer gives you the
opportunity to migrate checkpoint settings from any (version 4.0 or greater) light
forwarder residing on the same machine. See "Introducing the universal
forwarder" for a more detailed comparison of the universal and light forwarders.
For detailed information on the capabilities of heavy and light forwarders, see
"Heavy and light forwarder capabilities".
To learn how to enable and deploy a heavy or light forwarder, see "Deploy a
heavy or light forwarder".
Forwarder comparison
This table summarizes the similarities and differences among the three types of
forwarders:
4
Forwards to Splunk
Yes Yes Yes
Enterprise?
Forwards to 3rd
Yes Yes Yes
party systems?
Serves as
intermediate Yes Yes Yes
forwarder?
Indexer
acknowledgment Optional (version Optional (version
Optional
(guaranteed 4.2+) 4.2+)
delivery)?
Load balancing? Yes Yes Yes
Data cloning? Yes Yes Yes
Per-event filtering? No No Yes
Event routing? No No Yes
Event parsing? No No Yes
Optional, by
setting
Local indexing? No No indexAndForward
attribute in
outputs.conf
Searching/alerting? No No Optional
Splunk Web? No No Optional
For detailed information on specific capabilities, see the rest of this topic, as well
as the other forwarding topics in the manual.
• Raw
• Unparsed
• Parsed
The type of data a forwarder can send depends on the type of forwarder it is, as
well as how you configure it. Universal forwarders and light forwarders can send
raw or unparsed data. Heavy forwarders can send raw or parsed data.
5
With raw data, the data stream is forwarded as raw TCP; it is not converted into
Splunk's communications format. The forwarder just collects the data and
forwards it on. This is particularly useful for sending data to a non-Splunk system.
With parsed data, a heavy forwarder breaks the data into individual events,
which it tags and then forwards to a Splunk Enterprise indexer. It can also
examine the events. Because the data has been parsed, the forwarder can
perform conditional routing based on event data, such as field values.
The parsed and unparsed formats are both referred to as cooked data, to
distinguish them from raw data. By default, forwarders send cooked data — in
the universal forwarder's case, unparsed data, and in the heavy forwarder's case,
parsed data. To send raw data instead, set the sendCookedData=false
attribute/value pair in outputs.conf.
6
Data consolidation
For more information on data consolidation, read "Consolidate data from multiple
machines".
Load balancing
7
switching will occur at event boundaries.
In this diagram, three universal forwarders are each performing load balancing
between two indexers:
A forwarder can also filter and route events to specific queues, or discard them
altogether by routing to the null queue.
Here, a heavy forwarder routes data to three indexers based on event patterns:
8
For more information on routing and filtering, read "Route and filter data".
9
To learn more about forwarders and clusters, read "Use forwarders to get your
data" in the Managing Indexers and Clusters Manual. To learn more about
clusters in general, read "About clusters and index replication".
You can send raw data to a third-party system such as a syslog aggregator. You
can combine this with data routing, sending some data to a non-Splunk system
and other data to one or more Splunk Enterprise servers.
Here, three forwarders are routing data to two Splunk Enterprise servers and a
non-Splunk system:
Intermediate forwarding
To handle some advanced use cases, you might want to insert an intermediate
forwarder between a group of forwarders and the indexer. In this type of
scenario, the originating forwarders send data to a consolidating forwarder, which
then forwards the data on to an indexer, usually after indexing it locally.
Typical use cases are situations where you need an intermediate index, either for
"store-and-forward" requirements or to enable localized searching. (In this case,
10
you would need to use a heavy forwarder.) You can also use an intermediate
forwarder if you have some need to limit access to the indexer machine; for
instance, for security reasons.
11
Configure forwarding
To set up forwarding and receiving, you need to perform two basic actions, in this
order:
2. Set up one or more forwarders. These will forward data to the receivers.
The remainder of this topic lists the key steps involved, with links to more
detailed topics. The procedures vary somewhat according to whether the
forwarder is a universal forwarder or a heavy/light forwarder. Universal
forwarders can sometimes be installed and configured in a single step.
Heavy/light forwarders are first installed as full Splunk Enterprise instances and
then configured as forwarders.
Note: This topic assumes that your receivers are indexers. However, in some
scenarios, discussed elsewhere, a forwarder also serves as receiver. The set-up
is basically much the same for any kind of receiver.
Note: You cannot forward data across a proxy, because the communication
between forwarder and receiver does not use the HTTP protocol.
When using forwarders to send data to peer nodes in a cluster, you set up
forwarding and receiving a bit differently from the description in this topic. To
learn more about forwarders and clusters, read "Use forwarders to get your data"
in the Managing Indexers and Clusters manual.
12
Set up forwarding and receiving: universal forwarders
1. Install the full Splunk Enterprise instances that will serve as receivers. See the
Installation Manual for details.
2. Use Splunk Web or the CLI to enable receiving on the instances designated as
receivers. See "Enable a receiver" in this manual.
4. If you have not already done so during installation, you must specify data
inputs for each universal forwarder. See "What Splunk Enterprise can index" in
the Getting Data In manual.
Note: Since the universal forwarder does not include Splunk Web, you must
configure inputs through either the CLI or inputs.conf; you cannot configure
them in Splunk Web.
5. If you have not already done so during installation, you must specify the
universal forwarders' output configurations. You can do so through the CLI or by
editing the outputs.conf file. You get the greatest flexibility by editing
outputs.conf. For details, see the other topics in this section, including
"Configure forwarders with outputs.conf".
6. Test the results to confirm that forwarding, along with any configured
behaviors like load balancing or filtering, is occurring as expected.
Note: The light forwarder has been deprecated in Splunk Enterprise version 6.0.
For a list of all deprecated features, see the topic "Deprecated features" in the
Release Notes.
1. Install the full Splunk Enterprise instances that will serve as forwarders and
receivers. See the Installation Manual for details.
2. Use Splunk Web or the CLI to enable receiving on the instances designated as
receivers. See "Enable a receiver" in this manual.
13
3. Use Splunk Web or the CLI to enable forwarding on the instances designated
as forwarders. See "Deploy a heavy or light forwarder" in this manual.
4. Specify data inputs for the forwarders in the usual manner. See "What Splunk
Enterprise can index" in the Getting Data In manual.
6. Test the results to confirm that forwarding, along with any configured
behaviors like load balancing or routing, is occurring as expected.
In environments with multiple forwarders, you might find it helpful to use the
deployment server to update and manage your forwarders. See "About
deployment server" in the Updating Splunk Enterprise Instances manual.
To view the status of your forwarders, you can use the deployment monitor.
The following 6.0 features are available only if both indexers and forwarders are
at version 6.0 or higher:
14
forwarding scenario where intermediate links are light or universal forwarders.
Enable a receiver
To enable forwarding and receiving, you configure both a receiver and a
forwarder. The receiver is the Splunk Enterprise instance receiving the data; the
forwarder sends data to the receiver.
Depending on your needs (for example to enable load balancing), you might
have multiple receivers for each forwarder. Conversely, a single receiver usually
receives data from many forwarders.
The receiver is either a Splunk Enterprise indexer (the typical case) or another
forwarder (referred to as an "intermediate forwarder") configured to receive data
from forwarders.
You must set up the receiver first. You can then set up forwarders to send data to
that receiver.
Set up receiving
1. Log into Splunk Web as admin on the server that will be receiving data from a
forwarder.
15
4. Click Add new in the Receive data section.
5. Specify which TCP port you want the receiver to listen on (the listening port,
also known as the receiving port). For example, if you enter "9997," the receiver
will receive data on port 9997. By convention, receivers listen on port 9997, but
you can specify any unused port. You can use a tool like netstat to determine
what ports are available on your system. Make sure the port you select is not in
use by splunkweb or splunkd.
6. Click Save. You must restart the instance to complete the process.
For <port>, substitute the port you want the receiver to listen on (the receiving
port). For example, if you enter "9997," the receiver will receive data on port
9997. By convention, receivers listen on port 9997, but you can specify any
unused port. You can use a tool like netstat to determine what ports are
available on your system. Make sure the port you select is not in use by
splunkweb or splunkd.
To enable receiving, add a [splunktcp] stanza that specifies the receiving port.
In this example, the receiving port is 9997:
[splunktcp://9997]
disabled = 0
16
Note: The forms [splunktcp://9997] and [splunktcp://:9997] (one colon or
two) are semantically equivalent. Use either one.
Forwarding and indexing are OS-independent operations. You can employ any
combination of forwarders and receivers, as long as each is running on a certified
OS. For example, a Linux receiver can index data from a Windows universal
forwarder.
Once data has been forwarded and indexed, the next step is to search or
perform other knowledge-based activities on the data. At this point, the instance
performing such activities might need information about the OS whose data it is
examining. You typically handle this by installing the app specific to that OS. For
example, if you want a Linux instance to search OS-specific data forwarded from
Windows, you will ordinarily want to install the Windows app on the Linux
instance.
If the data you're interested in is not OS-specific, such as web logs, then you do
not need to install the Splunk OS app.
In addition, if the receiver is only indexing the data, and an external search head
is performing the actual searches, you do not need to install the OS app on the
receiver, but you might need to install it on the search head. As an alternative,
you can use a search head running the OS. For example, to search data
forwarded from Windows to a Linux receiver, you can use a Windows search
head pointing to the Linux indexer as a remote search peer. For more information
on search heads, see "About distributed search".
Important: After you have downloaded the relevant OS app, remove its
inputs.conf file before enabling the app, to ensure that its default inputs are not
added to your indexer. For the Windows app, the location is:
%SPLUNK_HOME%\etc\apps\windows\default\inputs.conf.
In summary, you only need to install the app for the forwarder's OS on the
receiver (or search head) if it will be performing searches on the forwarded OS
data.
17
Troubleshoot forwarder to receiver connectivity
If a receiving indexer's queues become full, it will close the receiver socket, to
prevent additional forwarders from connecting to it. If a forwarder with
load-balancing enabled can no longer forward to that receiver, it will send its data
to another indexer on its list. If the forwarder does not employ load-balancing, it
will hold the data until the problem is resolved.
The receiver socket will reopen automatically when the queue gets unclogged.
Typically, a receiver gets behind on the data flow because it can no longer write
data due to a full disk or because it is itself attempting to forward data to another
Splunk Enterprise instance that is not accepting data.
18
The following warning message will appear in splunkd.log if the socket gets
blocked:
Stopping all listening ports. Queues blocked for more than N seconds.
Disable receiving
To disable receiving through the CLI, run the splunk disable listen command:
You can also disable receiving by deleting the [splunktcp] stanza from
inputs.conf.
Answers
Have questions? Visit Splunk Answers and see what questions and answers the
Splunk community has around configuring forwarding.
19
The diagram illustrates a small deployment. In practice, the number of universal
forwarders in a data consolidation use case could number upwards into the
thousands.
1. Determine what data, originating from which machines, you need to access.
2. Install a Splunk Enterprise instance, typically on its own server. This instance
will function as the receiver. All indexing and searching will occur on it.
3. Enable the instance as a receiver through Splunk Web or the CLI. Using the
CLI, enter this command from $SPLUNK_HOME/bin/:
For <port>, substitute the port you want the receiver to listen on. This also
known as the "receiver port".
20
regarding this can be found here.
After you have downloaded the relevant app, remove its inputs.conf file before
enabling it, to ensure that its default inputs are not added to your indexer. For the
Windows app, the location is:
$SPLUNK_HOME/etc/apps/windows/default/inputs.conf.
6. Set up inputs for each forwarder. See "What Splunk Enterprise can index".
For <host>:<port>, substitute the host and receiver port number of the receiver.
For example, splunk_indexer.acme.com:9995.
Alternatively, if you have many forwarders, you can use an outputs.conf file to
specify the receiver. For example:
[tcpout:my_indexers]
server= splunk_indexer.acme.com:9995
You can create this file once, then distribute copies of it to each forwarder.
21
outages. If a machine goes down, the forwarder simply begins sending data to
the next available receiver.
Load balancing can also be of use when getting data from network devices like
routers. To handle syslog and other data generated across port 514, a single
heavy forwarder can monitor port 514 and distribute the incoming data across
several indexers.
Note: When implementing load balancing between forwarders and receivers, you
must use the forwarder's inherent capability. Do not use an external load
balancer. The use of external load balancers between forwarders and receivers
will not work properly. Do not attempt this unless you are prepared to monitor
your system for load distribution and take responsibility to identify when you are
having this class of problem.
To expand on this a bit, there is a data stream for each of the inputs that the
forwarder is configured to monitor. The forwarder determines if it is safe for a
data stream to switch to another indexer. Then, at the specified interval, it
switches the data stream to the newly selected indexer. If it cannot switch the
data stream to the new indexer safely, it keeps the connection to the previous
indexer open and continues to send the data stream until it has been safely sent.
Important: Universal forwarders are not able to switch indexers when monitoring
TCP network streams of data (including Syslog) unless an EOF is reached or an
indexer goes down, at which point the forwarder will switch to the next indexer in
the list. Because the universal forwarder does not parse the data and identify
event boundaries before forwarding the data to the indexer (unlike a heavy
forwarder), it has no way of knowing when it's safe to switch to the next indexer
unless it receives an EOF.
22
This diagram shows a typical load-balancing scenario, in which three forwarders
are sending load-balanced data across a set of two receiving indexers:
When configuring the set of target receivers, you can employ either DNS or static
lists.
DNS lists provide greater flexibility and simplified scale-up, particularly for large
deployments. Through DNS, you can change the set of receivers without needing
to re-edit each forwarder's outputs.conf file.
The main advantage of a static list is that it allows you to specify a different port
for each receiver. This is useful if you need to perform load balancing across
multiple receivers running on a single host. Each receiver can listen on a
separate port.
To use a static list for the target, you simply specify each of the receivers in the
target group's [tcpout] stanza in the forwarder's outputs.conf file. In this
example, the target group consists of three receivers, specified by IP address
and receiver port number:
[tcpout: my_LB_indexers]
23
server=10.10.10.1:9997,10.10.10.2:9996,10.10.10.3:9995
The universal forwarder will load balance between the three receivers listed. If
one receiver goes down, the forwarder automatically switches to another one on
the list.
To use a DNS list, edit your forwarder's outputs.conf file to specify a single host
in the target group's [tcpout] stanza. For example:
[tcpout:my_LB_indexers]
server=splunkreceiver.mycompany.com:9997
In your DNS server, create a DNS A record for each host's IP address,
referencing the server name you specified in outputs.conf. For example:
splunkreceiver.mycompany.com A 10.10.10.1
splunkreceiver.mycompany.com A 10.10.10.2
splunkreceiver.mycompany.com A 10.10.10.3
The forwarder will use the DNS list to load balance, sending data in intervals,
switching among the receivers specified. If a receiver is not available, the
forwarder skips it and sends data to another one on the list.
If you have a topology with many forwarders, the DNS list method allows you to
update the set of receivers by making changes in just a single location, without
touching the forwarders' outputs.conf files.
1. Install and enable a set of three Splunk Enterprise instances as receivers. This
example uses a DNS list to designate the receivers, so they must all listen on the
same port. For example, if the port is 9997, enable each receiver by going to its
24
$SPLUNK_HOME/bin/ location and using this CLI command:
splunkreceiver.mycompany.com A 10.10.10.1
splunkreceiver.mycompany.com A 10.10.10.2
splunkreceiver.mycompany.com A 10.10.10.3
4. Create a single outputs.conf file for use by all the forwarders. This one
specifies the DNS server name used in the DNS list and the port the receivers
are listening on:
[tcpout]
defaultGroup=my_LB_indexers
[tcpout:my_LB_indexers]
disabled=false
autoLBFrequency=40
server=splunkreceiver.mycompany.com:9997
5. Distribute the outputs.conf file to all the forwarders. You can use the
deployment server to handle the distribution.
The steps are similar if you're using a static list instead of DNS.
You can also use the CLI to specify load balancing. You do this when you start
forwarding activity to a set of receivers, using this syntax:
25
This example creates a load-balanced group of four receivers:
26
The universal forwarder
This section of the Distributed Deployment manual describes how to deploy the
universal forwarder for a variety of systems and needs. For information on the
different kinds of forwarders and detailed information on configuring them for a
range of topologies and use cases, see the "Forward data" chapter of this
manual.
The universal forwarder's sole purpose is to forward data. Unlike a full Splunk
Enterprise instance, you cannot use the universal forwarder to index or search
data. To achieve higher performance and a lighter footprint, it has several
limitations:
Full Splunk Enterprise comes bundled with Python. The universal forwarder does
not. Therefore, if you're currently using scripted inputs with Python and you want
to use those scripts with the universal forwarder, you must first install your own
27
version of Python. If you have been using calls specific to Splunk's Python
libraries, you cannot do so with the universal forwarder, because those libraries
exist only in full Splunk Enterprise. You may use other scripting languages for
scripted inputs with the universal forwarder if they are otherwise supported on the
target host (for example, Powershell on Windows Server 2008.)
• The universal forwarder puts less load on the CPU, uses less memory,
and has a smaller disk footprint.
• The universal forwarder has a default data transfer rate of 256Kbps
• The universal forwarder does not come bundled with Python.
• The universal forwarder is a forwarder only; it cannot be converted to a full
Splunk Enterprise instance.
Note: The light forwarder has been deprecated in Splunk Enterprise version 6.0.
For a list of all deprecated features, see the topic "Deprecated features" in the
Release Notes.
Read on!
For information on deploying the universal forwarder, see the topics that directly
follow this one.
For information on using the universal forwarder to forward data and participate
in various distributed topologies, see the topics in the "Forward data" section of
this manual. Those topics also discuss light and heavy forwarders.
For information on third-party Windows binaries that the Windows version of the
Splunk Enterprise universal forwarder ships with, read "Information on Windows
28
third-party binaries distributed with Splunk Enterprise" in the Installation Manual.
For information about running the universal forwarder in Windows Safe Mode,
read "Splunk Enterprise Architecture and Processes" in the Installation Manual.
Deployment overview
The topics in this chapter describe how to install and deploy the universal
forwarder. They include use cases that focus on installing and configuring the
forwarder for a number of different scenarios.
• the topics in the chapter "Forward data" for an overview of forwarding and
forwarders.
• the topics in the chapter "Configure forwarding" to learn how to configure
forwarders.
• the subtopic "Set up forwarding and receiving: universal forwarders" for a
overview of configuring forwarding and receiving.
Types of deployments
These are the main scenarios for deploying the universal forwarder:
Each scenario is described in its own topic. For most scenarios, there are
separate Windows and *nix topics.
29
Before you start
When using forwarders to send data to peer nodes in a cluster, you deploy and
configure them a bit differently from the description in this topic. To learn more
about forwarders and clusters, read "Use forwarders to get your data" in the
Managing Indexers and Clusters Manual.
System requirements
See the Installation manual for specific hardware requirements and supported
operating systems.
Licensing requirements
The universal forwarder ships with a pre-installed license. See "Types of Splunk
Enterprise licenses" in the Admin manual for details.
Other requirements
You must have admin or equivalent rights on the machine where you're installing
the universal forwarder.
Steps to deployment
The actual procedure varies depending on the type of deployment, but these are
the typical steps:
30
6. Deploy the universal forwarder to machines across your environment (for
multi-machine deployments).
Important: Deploying your forwarders is just one step in the overall process of
setting up forwarding and receiving. For an overview of that process, read "Set
up forwarding and receiving: universal forwarders".
Here are some of the issues to consider when planning your deployment:
• How many (and what type of) machines will you be deploying to?
• Will you be deploying across multiple OS's?
• Do you need to migrate from any existing forwarders?
• What, if any, deployment tools do you plan to use?
• Will you be deploying via a system image or virtual machine?
• Will you be deploying fully configured universal forwarders, or do you plan
to complete the configuration after the universal forwarders have been
deployed across your system?
• What level of security does the communication between universal
forwarder and indexer require?
For next steps, see the topic in this chapter that matches your deployment
requirements most closely. Each topic contains one or more use cases that cover
specific deployment scenarios from installation through configuration and
deployment:
31
But first, read the next section to learn more about universal forwarder
configuration.
Note: The universal forwarder's executable is named splunkd, the same as the
executable for full Splunk Enterprise. The service name is
SplunkUniversalForwarder.
Because the universal forwarder has no Splunk Web GUI, you must perform all
configuration either during installation (Windows-only) or later, as a separate
step. To perform post-installation configuration, you can use the CLI, modify the
configuration files directly, or use deployment server.
Where to configure
Key configuration files include inputs.conf (for data inputs) and outputs.conf (for
data outputs). Others include server.conf and deploymentclient.conf.
When you make configuration changes with the CLI, the universal forwarder
writes the changes to configuration files in the search app (except for changes to
outputs.conf, which it writes to a file in $SPLUNK_HOME/etc/system/local/). The
search app is the default app for the universal forwarder, even though you cannot
actually use the universal forwarder to perform searches. If this seems odd, it is.
32
• The topics in the "Use the forwarder to create deployment topologies"
section, for information on configuring outputs with the CLI.
• "Configure your inputs" in the Getting Data In manual, for details on
configuring data inputs with inputs.conf or the CLI.
These are the main methods for deploying configuration updates across your set
of universal forwarders:
• Edit or copy the configuration files for each universal forwarder manually
(for small deployments only).
• Use the Splunk deployment server to push configured apps to your set of
universal forwarders.
• Use your own deployment tools to push configuration changes.
Some configuration changes might require that you restart the forwarder. (The
topics covering specific configuration changes will let you know if a change does
require a restart.)
To restart the universal forwarder, use the same CLI restart command that you
use to restart a full Splunk Enterprise instance:
• On *nix systems: From a shell prompt on the host, run this command:
# splunk restart
The universal forwarder provides all the functionality of the old light forwarder
but in a smaller footprint with better performance. Therefore, you might want to
migrate your existing light forwarder installations to universal forwarders. Splunk
provides tools that ease the migration process and ensure that the new universal
forwarder does not send an indexer any data already sent by the old light
forwarder.
Note: You can only migrate from light forwarders of version 4.0 or later.
33
Migration is available as an option during the universal forwarder installation
process. See "Migrate a Windows forwarder" or "Migrate a nix forwarder" for
details. You will want to uninstall the old light forwarder instance once your
universal forwarder is up and running (and once you've tested to ensure
migration worked correctly).
Migration copies checkpoint data, including the fishbucket directory, from the old
forwarder to the new universal forwarder. This prevents the universal forwarder
from re-forwarding data that the previous forwarder had already sent to an
indexer. This in turn avoids unnecessary re-indexing, ensuring that you maintain
your statistics and keep your license usage under control. Specifically, migration
copies:
If the data inputs for the universal forwarder differ from the old forwarder, you can
still migrate. Migrated checkpoint data pertaining to any inputs not configured for
the universal forwarder will just be ignored. If you decide to add those inputs
later, the universal forwarder will use the migrated checkpoints to determine
where in the data stream to start forwarding.
Migration also does not copy over any apps from the light forwarder. If you have
any apps that you want to migrate to the universal forwarder, you'll need to do so
manually.
34
Supported CLI commands
The universal forwarder supports a subset of objects for use in CLI commands.
Certain objects valid in full Splunk Enterprise, like index (as in add index), make
no sense in the context of the universal forwarder.
The universal forwarder supports all CLI commands for these objects:
ad
app
config
datastore-dir
default-hostname
deploy-client
deploy-poll
eventlog
exec
forward-server
monitor
oneshot
perfmon
registry
servername
splunkd-port
tcp
udp
user
wmi
Note: A few commands, such as start and stop can be run without an object. A
command with no object is also valid for the universal forwarder.
35
As described above, it's the object that determines whether a command is valid
in the universal forwarder. For example, the above list includes the monitor
object. Therefore, the add monitor and edit monitor command/object
combinations are both valid. For more information on the monitor object, see
"Use the CLI to monitor files and directories" in the Getting Data In manual.
For more details on using the CLI in general, see the "Administer Splunk
Enterprise with the CLI" chapter in the Admin manual. In particular, the topic "CLI
admin commands" provides details on CLI syntax, including a list of all
commands supported by full Splunk Enterprise and the objects they can act
upon.
36
Deploy Windows universal forwarders
• small deployments
• proof-of-concept test deployments
• system image or virtual machine for eventual cloning
You can also install the universal forwarder from the command line, using
msiexec. The command-line deployment provides more configuration options, for
data inputs and other settings. See "Deploy a Windows universal forwarder via
the command line" for more information.
Important: If you do not want the universal forwarder to start immediately after
installation, you must install via the command line.
Steps to deployment
Once you have downloaded the universal forwarder and planned your
deployment, as described in "Deployment overview", perform these steps:
37
Before you install
Choose where the universal forwarder will get its data from
When you install the universal forwarder, you can select where the forwarder will
get its data. You have two choices:
If you tell the installer to collect Local Data only, the universal forwarder can
collect any kind of data that is available on the local machine. It cannot, however,
collect data from other machines.
You must tell the forwarder to collect Remote Windows Data if you intend to do
any of the following:
If you tell the installer to collect Remote Windows data, you must then specify a
user which has access to this data. Read "Choose the Windows user Splunk
should run as" in the Installation Manual for concepts and procedures on the user
requirements that must be in place before you collect remote Windows data.
Important: You should choose - and configure - the user that Splunk will run as
before attempting to install a universal forwarder for remote Windows data
collection.
If you do not need to install the universal forwarder to collect remote Windows
data, you can continue to the installation instructions below.
If your monitoring needs require you to install the universal forwarder to collect
remote Windows data, then you must configure your Windows environment for
the proper installation of the forwarder.
1. Create and configure security groups with the user you want the universal
forwarder to run as.
38
2. Optionally, configure the universal forwarder account as a managed service
account.
3. Create and configure Group Policy objects for security policy and user rights
assignment.
5. Deploy the GPO(s) with the updated settings to the appropriate objects.
Note: These steps are high-level procedures only. For step-by-step instructions,
read "Prepare your Windows network for a Splunk Enterprise installation as a
network or domain user" in the Installation Manual.
The Windows installer guides you through the process of installing and
configuring your universal forwarder. It also offers you the option of migrating
your checkpoint settings from an existing forwarder.
The value of <...> varies according to the particular release; for example,
splunkuniversalforwarder-4.2-86454-x64-release.msi.
A series of dialogs guides you through the installation. When you're through with
a dialog, click Next to move to the next in the series. Here are the dialogs, in
order:
1. "Welcome" dialog
39
Read the license agreement and select "I accept the terms in the license
agreement".
Caution: Do not install the universal forwarder over an existing installation of full
Splunk Enterprise. This is particularly important if you are upgrading from a light
forwarder, as described in "Migrate a Windows light forwarder". The default
installation directory for full Splunk Enterprise is C:\Program Files\Splunk, so, if
you stick with the defaults, you're safe.
4. "Migration" pop-up
If the installer detects an existing version of Splunk Enterprise, it will ask you
whether or not you want to migrate the data checkpoint settings to the universal
forwarder. If you click Yes, it will automatically perform the migration.
Important: This is the only time when you can migrate old settings to this
universal forwarder. You cannot perform the migration later.
See "Migrate a Windows forwarder" for more information on what migration does.
Enter the hostname or IP address and management port for your deployment
server. The default management port is 8089.
You can use the deployment server to push configuration updates to the
universal forwarder. See "About deployment server" in the Updating Splunk
Enterprise Instances manual for details.
Note: This step is optional, but if you skip it, you must enter a receiving indexer
in step 6; otherwise, the universal forwarder does not do anything, as it does not
have any way of determining which indexer to forward data to.
40
Enter the hostname or IP address and receiving port of the receiving indexer
(receiver). For information on setting up a receiver, see "Enable a receiver".
Note: This step is optional, but if you skip it, you must enter a deployment server
in step 5; otherwise, the universal forwarder does not do anything, as it does not
have any way of determining which indexer to forward to.
Select an SSL certificate for verifying the identity of this machine. This step is
optional.
Note: This dialog will only appear if you previously specified a receiving indexer
(step 6).
This step in the installer requires one or two dialogs, depending on whether the
universal forwarder will be collecting local data exclusively.
In the first dialog, you specify the user context: whether you want the universal
forwarder to collect only local data or also remote Windows data. The installer
uses this information to determine the permissions the universal forwarder
needs.
Note: If you select Local data only, the universal forwarder installs as the Local
System user, and network resources will not be available to it. This is
recommended for improved security, unless this universal forwarder will be
collecting event logs or metrics from remote machines.
For more help in determining what to select here, see "Before you install" earlier
in this topic.
If you specified Local data only, the installer skips the second screen and takes
you directly to the "Enable Windows Inputs" dialog (step 8).
41
If you specified Remote Windows data, the installer now takes you to a second
dialog, where you need to enter domain and user information for this instance of
the universal forwarder. The universal forwarder will run as the user you specify
in this dialog.
Important: The user you specify must have specific rights assigned to it prior to
completing the installation. Failure to do so might result in a failed installation.
Read "Before you install" earlier in this topic for specific information and links to
step-by-step instructions.
This step is optional. You can enable inputs later, by editing inputs.conf within
the universal forwarder directory.
If you migrated from an existing forwarder, make sure that the universal
forwarder is forwarding data from where the old forwarder left off. If it isn't, you
need to modify or add data inputs, so that they conform to those on the old
forwarder.
Important: Migration does not automatically copy any configuration files. You
must set those up yourself. The usual way to do this is to copy the files, including
inputs.conf, from the old forwarder to the universal forwarder. Compare the
42
inputs.conf files on the universal forwarder and the old forwarder to ensure that
the universal forwarder has all the inputs that you want to maintain.
If you migrated from an existing forwarder, you can delete that old instance once
your universal forwarder has been thoroughly tested and you're comfortable with
the results.
Note: When you use the CLI, you might need to authenticate into the forwarder
to complete commands. The default credentials for a universal forwarder are:
Username: admin
Password: changeme
If you need just a few universal forwarders, you might find it simpler just to repeat
the manual installation process, as documented in this topic. If you need to install
a larger number of universal forwarders, it will probably be easier to deploy them
remotely with a deployment tool or else as part of a system image or virtual
machine.
1. Use the Services MMC snap-in (Start > Administrative Tools > Services) to
stop the SplunkForwarder service.
Note: You can also stop the service from the command line with the following
command:
43
2. Next, use the Add or Remove Programs control panel to uninstall the
forwarder. On Windows 7, 8, Server 2008, and Server 2012, that option is
available under Programs and Features.
Note: Under some circumstances, the Microsoft installer might present a reboot
prompt during the uninstall process. You can safely ignore this request without
rebooting.
You can manually install the universal forwarder on individual machines from a
command prompt or PowerShell window. Here are some scenarios where
installing from the command line is useful:
• You want to install the forwarder, but don't want it to start right away.
• You want to automate installation of the forwarder with a script.
• You want to install the forwarder on a system that you will clone later.
• You want to use a deployment tool such as Group Policy or System
Center Configuration Manager.
Steps to deployment
Once you have downloaded the universal forwarder and have planned your
deployment, as described in "Deployment overview", perform these steps:
44
2. Test and tune the deployment.
When you install the universal forwarder, you can select the user it should run as.
By default, the user is Local System. To specify a domain account, use the flags
LOGON_USERNAME and LOGON_PASSWORD, described later in this topic.
If you install the forwarder as the Local System user, the forwarder can collect
any kind of data that is available on the local machine. It cannot, however, collect
data from other machines. This is by design.
You must give the universal forwarder a user account if you intend to do any of
the following:
Read "Choose the Windows user Splunk should run as" in the Installation
Manual for concepts and procedures on the user requirements that must be in
place before you collect remote Windows data.
Important: You must choose - and configure - the user that Splunk will run as
before attempting to install a universal forwarder for remote Windows data
collection. Failure to do so can result in a failed installation.
1. Create and configure security groups with the user you want the universal
forwarder to run as.
45
2. Optionally, configure the universal forwarder account as a managed service
account.
3. Create and configure Group Policy or Local Security Policy objects for user
rights assignments.
5. If using Active Directory, deploy the Group Policy object(s) with the updated
settings to the appropriate objects.
Note: These steps are high-level procedures only. For step-by-step instructions,
read "Prepare your Windows network for a Splunk Enterprise installation as a
network or domain user" in the Installation Manual.
You can install the universal forwarder from the command line by invoking
msiexec.exe, Microsoft's installer program.
msiexec.exe /i splunkuniversalforwarder-<...>-x86-release.msi
[<flag>]... [/quiet]
msiexec.exe /i splunkuniversalforwarder-<...>-x64-release.msi
[<flag>]... [/quiet]
The value of <...> varies according to the particular release; for example,
splunkuniversalforwarder-4.2-86454-x64-release.msi.
Command line flags allow you to configure your forwarder at installation time.
Using command line flags, you can specify a number of settings, including:
46
• The user the universal forwarder runs as. (Be sure the user you specify
has the appropriate permissions to access the content you want to
forward.)
• The receiving Splunk Enterprise instance that the universal forwarder will
send data to.
• A deployment server for updating the configuration.
• The Windows event logs to index.
• Whether the universal forwarder should start automatically when the
installation is completed.
• Whether to migrate checkpoint data from an existing light forwarder.
The following sections list the flags available and provide a few examples of
various configurations.
Important: The installer for the full version of Splunk Enterprise is a separate
executable, with its own installation flags. See "Install on Windows" in the
Installation Manual.
Important: Do not
install the
universal
forwarder over an
existing installation
of full Splunk
Enterprise. This is
particularly vital if
you are migrating
from a light
forwarder as
47
described in
"Migrate a
Windows light
forwarder". The
default install
directory for full
Splunk Enterprise
is C:\Program
Files\Splunk, so,
if you stick with the
defaults, you're
safe.
Use these flags to
provide
domain\username
and password
information for the
user to run the
SplunkForwarder
service. You must
specify the domain
with the username
LOGON_USERNAME="<domain\username>"
in the format:
n/a
domain\username.
LOGON_PASSWORD="<pass>"
If you don't include
these flags, the
universal
forwarder installs
as the Local
System user. See
"Choose the
Windows user
Splunk should run
as".
RECEIVING_INDEXER="<host:port>" Use this flag to n/a
specify the
receiving indexer
to which the
universal
forwarder will
forward data.
Enter the name
48
(hostname or IP
address) and
receiving port of
the receiver. This
flag accepts only a
single receiver. To
specify multiple
receivers (to
implement load
balancing), you
must instead
configure this
setting through the
CLI or
outputs.conf.
For information on
setting up a
receiver, see
"Enable a
receiver". Note:
This flag is
optional, but if you
don't specify it and
also don't specify
DEPLOYMENT_SERVER,
the universal
forwarder will be
unable to function,
as it will not have
any way of
determining which
indexer to forward
to.
DEPLOYMENT_SERVER="<host:port>" Use this flag to n/a
specify a
deployment
server for pushing
configuration
updates to the
universal
forwarder. Enter
49
the deployment
server's name
(hostname or IP
address) and port.
Note: By setting
LAUNCHSPLUNK to 0
and
SERVICESTARTTYPE
to auto, you will
cause the
50
universal
forwarder to not
start forwarding
until the next
system boot. This
is useful when
cloning a system
image.
Use this flag to
specify a file or
MONITOR_PATH="<directory_path>" n/a
directory to
monitor.
Use these flags to
enable these
Windows event
logs, respectively:
WINEVENTLOG_APP_ENABLE=1|0 application
WINEVENTLOG_SEC_ENABLE=1|0 security
0 (no)
WINEVENTLOG_SYS_ENABLE=1|0 system
WINEVENTLOG_FWD_ENABLE=1|0 forwarders
WINEVENTLOG_SET_ENABLE=1|0 setup
51
monitoring for a
remote
deployment.
Use these flags to
supply SSL
certificates:
Password for
private key of
CERTFILE
(optional).
52
the new universal
forwarder. You are
responsible for
uninstalling the old
forwarder. See
"Deployment
overview" and
"Migrate a
Windows light
forwarder" for
details.
Deletes any
instance-specific
data in preparation
for creating a
clone of a 0 (do not prepare the ins
CLONEPREP=1|0
machine. This cloning.)
invokes the splunk
clone-prep
command from the
CLI.
Silent installation
To run the installation silently, add /quiet to the end of your installation
command string. You must also set the AGREETOLICENSE=Yes flag.
If your system is running UAC (which is sometimes on by default), you must run
the installation as Administrator. To do this, when opening a cmd prompt, right
click and select "Run As Administrator". Then use the cmd window to run the
silent install command.
Examples
Install the universal forwarder to run as the Local System user and request
configuration from deploymentserver1
msiexec.exe /i splunkuniversalforwarder_x86.msi
53
DEPLOYMENT_SERVER="deploymentserver1:8089" AGREETOLICENSE=Yes /quiet
Install the universal forwarder to run as a domain user, but do not launch it
immediately
msiexec.exe /i splunkuniversalforwarder_x86.msi
LOGON_USERNAME="AD\splunk" LOGON_PASSWORD="splunk123"
DEPLOYMENT_SERVER="deploymentserver1:8089" LAUNCHSPLUNK=0
AGREETOLICENSE=Yes /quiet
You might do this to collect just the Security and System event logs through a
"fire-and-forget" installation.
msiexec.exe /i splunkuniversalforwarder_x86.msi
RECEIVING_INDEXER="indexer1:9997" WINEVENTLOG_SEC_ENABLE=1
WINEVENTLOG_SYS_ENABLE=1 AGREETOLICENSE=Yes /quiet
Install the universal forwarder, migrate from an existing forwarder, and run
the installer in silent mode
You might do this if you want to migrate now and redefine your inputs later,
perhaps after a validation step.
msiexec.exe /i splunkuniversalforwarder_x86.msi
RECEIVING_INDEXER="indexer1:9997" MIGRATESPLUNK=1 AGREETOLICENSE=Yes
/quiet
If you migrated from an existing forwarder, make sure that the universal
forwarder is forwarding data from where the old forwarder left off. If it isn't, you
54
probably need to modify or add data inputs, so that they conform to those on the
old forwarder.
Important: Migration does not automatically copy any configuration files; you
must set those up yourself. The usual way to do this is to copy the files, including
inputs.conf, from the old forwarder to the universal forwarder. Compare the
inputs.conf files on the universal forwarder and the old forwarder to ensure that
the universal forwarder has all the inputs that you want to maintain.
If you migrated from an existing forwarder, you can delete that old instance once
your universal forwarder has been thoroughly tested and you're comfortable with
the results.
Note: When you use the CLI, you might need to authenticate into the forwarder
to complete commands. The default credentials for a universal forwarder are:
Username: admin
Password: changeme
If you need just a few universal forwarders, you might find it simpler just to repeat
the command line installation process manually, as documented in this topic. If
you need to install a larger number of universal forwarders, it will probably be
easier to deploy them remotely with a deployment tool or else as part of a system
image or virtual machine.
55
1. Stop the service from the command line with the following command:
2. Next, use the Add or Remove Programs control panel to uninstall the
forwarder. On Windows 7, 8, Server 2008, and Server 2012, that option is
available under Programs and Features.
Note: Under some circumstances, the Microsoft installer might present a reboot
prompt during the uninstall process. You can safely ignore this request without
rebooting.
For this type of deployment, you install via the Windows command line interface.
During installation, you must specify all configuration options and use silent mode
(/quiet). See "Deploy a Windows universal forwarder via the command line" for
information on the command line interface, including a list of supported flags,
including those that enable low-privilege operation.
Steps to deployment
Once you have downloaded the universal forwarder and have planned your
deployment, as described in "Deployment overview", perform these steps:
1. Install and configure the universal forwarder on a test machine, using the
command line interface with the desired flags.
56
3. Load the universal forwarder MSI into your deployment tool, specifying the
tested flags.
5. Use the deployment monitor to verify that the universal forwarders are
functioning.
• AGREETOLICENSE=Yes
• RECEIVING_INDEXER="<server:port>"
• At least one data input flag, such as WINEVENTLOG_APP_ENABLE=1. You can
add as many data input flags as you need.
See "Deploy a Windows universal forwarder via the command line" for a list of all
available command line flags.
Example installation
This example sets the universal forwarder to run as Local System user, get
inputs from Windows security and system event logs, send data to indexer1, and
launch automatically:
msiexec.exe /i splunkuniversalforwarder_x86.msi
RECEIVING_INDEXER="indexer1:9997" WINEVENTLOG_SEC_ENABLE=1
WINEVENTLOG_SYS_ENABLE=1 AGREETOLICENSE=Yes /quiet
Deploy with a secure configuration
To deploy a secure configuration, you can specify an SSL certifcate. Use these
installation flags:
• CERTFILE=<c:\path\to\certfile.pem>
• ROOTCACERTFILE=<c:\path\to\rootcacertfile.pem>
• CERTPASSWORD=<password>
57
Test the deployment
Steps to deployment
Once you have downloaded the universal forwarder and have planned your
deployment, as described in "Deployment overview", perform these steps:
4. Install the universal forwarder with the tested configuration onto a source
machine.
./splunk clone-prep-clear-config
This clears instance-specific information, such as the server name and GUID,
from the forwarder. This information will then be configured on each cloned
forwarder at initial start-up.
58
7. Prep your image or virtual machine, as necessary, for cloning.
8. On *nix systems, set the splunkd daemon to start on boot using cron or your
scheduling system of choice. On Windows, set the service to Automatic but do
not start it.
10. Use the deployment monitor to verify that the cloned universal forwarders
are functioning.
Referenced procedures
Install the universal forwarder using the procedure specific to your operating
system:
• For a Windows machine, you can use the installer GUI or the command
line interface. To install with the GUI, see "Deploy a Windows universal
forwarder via the installer GUI". For information on the command line
interface, see "Deploy a Windows universal forwarder via the command
line".
At the time of installation, you can also configure the universal forwarder. See
"General configuration issues" in the Deployment Overview.
59
See "Deployment overview" for information.
You can migrate checkpoint data from an existing Windows light forwarder
(version 4.0 or later) to the universal forwarder. For an overview of migration, see
"Migrating from a light forwarder" in the Deployment Overview.
If you want to migrate, you must do so during the installation process. You
cannot migrate post-installation.
You perform a Windows installation with either the installer GUI or the
commandline:
• If you use the installer GUI, one of the screens will prompt you to
migrate. See "Deploy a Windows universal forwarder via the installer GUI"
for a walkthrough of the GUI installation procedure.
60
Important: You must install the universal forwarder in a different directory from
the existing light forwarder. Since the default install directory for the universal
forwarder is C:\Program Files\SplunkUniversalForwarder and the default install
directory for full Splunk Enterprise (including the light forwarder) is C:\Program
Files\Splunk, you'll be safe if you just stick with the defaults.
Whichever installation method you use, the Windows installer performs the
following actions:
3. If it finds an eligible forwarder, the GUI offers the user the option of migrating.
(The commandline installer looks to see whether the MIGRATESPLUNK=1 flag
exists.)
4. If user specifies migration (or the MIGRATESPLUNK=1 flag exists), the installer
shuts down any running services (splunkd and, if running, splunkweb) for the
existing forwarder. It also sets the startup type of the services to manual, so that
they don't start up again upon reboot.
At the end of this process, you might want to perform additional configuration on
the universal forwarder. Since the migration process only copies checkpoint files,
you will probably want to manually copy over the old forwarder's inputs.conf
configuration file (or at least examine it, to determine what data inputs it was
monitoring).
Once the universal forwarder is up and running (and after you've tested to ensure
migration worked correctly), you can uninstall the old forwarder.
61
Deploy nix universal forwarders
• small deployments
• proof-of-concept test deployments
• system image or virtual machine for eventual cloning
If you are interested in a different deployment scenario, look for another topic in
this section that better fits your needs.
Steps to deployment
Once you have downloaded the universal forwarder and have planned your
deployment, as described in "Deployment overview", perform these steps:
You can install the universal forwarder on a *nix machine using a package or a
tar file. To install the universal forwarder on any of the supported *nix
environments, see the set of *nix install topics in the Installation manual:
• Install on Linux
• Install on Solaris
• Install on Mac OS
62
• Install on FreeBSD
• Install on AIX
• Install on HP-UX
You install the universal forwarder the same way that you install a full Splunk
Enterprise instance, as documented in these topics in the Installation manual.
There are only two differences:
For example, if installing the universal forwarder onto Red Hat Linux, use this
command:
rpm -i splunkforwarder_<package_name>.rpm
rpm -i splunk_<package_name>.rpm
The only difference is the prefix to the package name: "splunkforwarder", instead
of "splunk".
The universal forwarder can run as any user on the local system. If you run the
63
universal forwarder as a non-root user, make sure that it has the appropriate
permissions to read the inputs that you specify. Refer to the instructions for
running Splunk as a non-root user for more information.
Important: If you want to migrate from an existing forwarder, you must perform a
specific set of actions before you start the universal forwarder for the first time.
See "Migrate a nix forwarder" for details.
splunk start
The first time you start the universal forwarder after a new installation, you must
accept the license agreement. To start the universal forwarder and accept the
license in one step:
Configuration steps
After you start the universal forwarder and accept the license agreement, follow
these steps to configure it:
64
2. Configure universal forwarder to act as a deployment client (optional). To do
this, just specify the deployment server:
where:
where:
During this step, you can also configure a certificate for secure intra-Splunk
communications, using a set of optional ssl flags to specify a certificate, root CA,
and password. For example:
65
4. To configure the universal forwarder's inputs, use the CLI add command or edit
inputs.conf. See "About the CLI" and subsequent topics for details on using the
CLI.
For a complete list of CLI commands supported in the universal forwarder, see
"Supported CLI commands".
If you migrated from an existing forwarder, make sure that the universal
forwarder is forwarding data from where the old forwarder left off. If it isn't, you
probably need to modify or add data inputs, so that they conform to those on the
old forwarder. Examine the two inputs.conf files to ensure that the new
universal forwarder has all the inputs that you want to maintain.
If you migrated from an existing forwarder, you can delete that old instance once
your universal forwarder has been thoroughly tested and you're comfortable with
the results.
In addition to using the CLI, you can update the universal forwarder's
configuration by editing its configuration files, such as inputs.conf and
outputs.conf, directly. See "Deployment overview" for information.
If you need just a few universal forwarders, you might find it simpler just to repeat
the installation process manually, as documented in this topic. If you need to
install a larger number of universal forwarders, however, it will probably be easier
66
to deploy them remotely (using scripting or a deployment tool) or else as part of a
system image or virtual machine.
The universal forwarder forwards some internal logs to the receiving indexer.
These are:
$SPLUNK_HOME/var/log/splunk/splunkd.log
$SPLUNK_HOME/var/log/splunk/license_audit.log
If the universal forwarder is malfunctioning such that it cannot forward the logs,
use a text editor or grep to examine them on the universal forwarder machine
itself.
For information on how to install and configure a single universal forwarder, see
"Deploy a nix universal forwarder manually". That topic explains how to install
onto a wide variety of *nix platforms from a package or a tar file and how to
configure (and optionally migrate) using the CLI.
Steps to deployment
Once you have downloaded the universal forwarder and have planned your
deployment, as described in "Deployment overview", perform these steps:
67
3. Create a script wrapper for the installation and configuration commands.
4. Run the script on representative target machines to verify that it works with all
required shells.
6. Use the deployment monitor to verify that the universal forwarders are
functioning properly.
Script requirements
You need to place the installation package or tar file in a network location
accessible by the target machines. You can set this up so that the script pushes
the file over to each target host, or you can place the file in a generally
accessible location, such as an NFS mount.
The script is responsible for error reporting. Logging to Splunk either directly or
via a flat file is recommended.
Sample script
Here's a sample script you can use as a starting point. Note that this is only an
example of the type of script you could create for your deployment. The
comments in the script provide some guidance on how to modify it for your
needs; however, the script will likely require further modification, beyond that
indicated by the comments.
• Deploys the forwarder's tar file to a list of hosts specified in a file that the
HOST_FILE variable points to. You will need to provide this file, in the
format specified in the script comments.
• Specifies the location on each destination host where the tar file will get
unpacked.
68
• Specifies a Splunk Enterprise instance to serve as a deployment server
that can subsequently manage and update the forwarders. This is an
optional configuration step.
The script is well commented; be sure to study it carefully before modifying it for
your environment.
#!/bin/sh
# Populate this file with a list of hosts that this script should
install to,
# with one host per line. You may use hostnames or IP addresses, as
# applicable. You can also specify a user to login as, for example,
"foo@host".
#
# Example file contents:
# server1
# server2.foo.lan
# you@server3
# 10.2.3.4
HOSTS_FILE="/path/to/splunk.install.list"
# This is the path to the tar file that you wish to push out. You may
# wish to make this a symlink to a versioned tar file, so as to minimize
# updates to this script in the future.
SPLUNK_FILE="/path/to/splunk-latest.tar.gz"
# This is where the tar file will be stored on the remote host during
# installation. The file will be removed after installation. You
69
normally will
# not need to set this variable, as $NEW_PARENT will be used by default.
#
# SCRATCH_DIR="/home/your_dir/temp"
# The location in which to unpack the new tar file on the destination
# host. This can be the same parent dir as for your existing
# installation (if any). This directory will be created at runtime, if
it does
# not exist.
NEW_PARENT="/opt"
LOG_DIR="/tmp/splunkua.install"
# If you use a non-standard SSH port on the remote hosts, you must set
this.
70
# SSH_PORT=1234
# You must remove this line, or the script will refuse to run. This is
to
# ensure that all of the above has been read and set. :)
UNCONFIGURED=1
# helpers.
faillog() {
echo "$1" >&2
}
fail() {
faillog "ERROR: $@"
exit 1
}
# error checks.
# some setup.
if [ -z "$SCRATCH_DIR" ]; then
SCRATCH_DIR="$NEW_PARENT"
fi
if [ -n "$SSH_PORT" ]; then
SSH_PORT_ARG="-p${SSH_PORT}"
SCP_PORT_ARG="-P${SSH_PORT}"
fi
71
#
# create script to run remotely.
#
#
REMOTE_SCRIPT="
fail() {
echo ERROR: \"\$@\" >&2
test -f \"$DEST_FILE\" && rm -f \"$DEST_FILE\"
exit 1
}
"
### setup seed file to migrate input records from old instance, and
stop old instance.
if [ -n "$OLD_SPLUNK" ]; then
REMOTE_SCRIPT="$REMOTE_SCRIPT
echo \"$OLD_SPLUNK\" > \"$NEW_INSTANCE/old_splunk.seed\" || fail
\"could not create seed file.\"
\"$OLD_SPLUNK/bin/splunk\" stop || fail \"could not stop existing
splunk.\"
"
fi
72
#
#
# end of remote script.
#
#
echo "In 5 seconds, will copy install file and run the following script
on each"
echo "remote host:"
echo
echo "===================="
echo "$REMOTE_SCRIPT"
echo "===================="
echo
echo "Press Ctrl-C to cancel..."
test -z "$MORE_FASTER" && sleep 5
echo "Starting."
LOG="$LOG_DIR/$DST"
FAILLOG="${LOG}.failed"
echo "Installing on host $DST, logging to $LOG."
73
exec 2>&6
continue
fi
# restore stdout/stderr.
exec 1>&5
exec 2>&6
if [ -e "$FAILLOG" ]; then
echo " --> FAILED <--"
else
echo " SUCCEEDED"
fi
done
# Voila.
Once you've executed the script, check any log files generated by your
installation script for errors. For example, the sample script saves to
/tmp/splunkua.install/<destination hostname>.
74
Before following the procedures in this topic, read "Deployment overview".
Steps to deployment
Once you have downloaded the universal forwarder and have planned your
deployment, as described in "Deployment overview", perform these steps:
4. Install the universal forwarder with the tested configuration onto a source
machine.
./splunk clone-prep-clear-config
This clears instance-specific information, such as the server name and GUID,
from the forwarder. This information will then be configured on each cloned
forwarder at initial start-up.
8. On *nix systems, set the splunkd daemon to start on boot using cron or your
scheduling system of choice. On Windows, set the service to Automatic but do
not start it.
10. Use the deployment monitor to verify that the cloned universal forwarders
are functioning.
Referenced procedures
75
Install the universal forwarder
Install the universal forwarder using the procedure specific to your operating
system:
• For a Windows machine, you can use the installer GUI or the command
line interface. To install with the GUI, see "Deploy a Windows universal
forwarder via the installer GUI". For information on the command line
interface, see "Deploy a Windows universal forwarder via the command
line".
At the time of installation, you can also configure the universal forwarder. See
"General configuration issues" in the Deployment Overview.
76
Migrate a *nix light forwarder
If you want to replace an existing light forwarder with a universal forwarder, you
need to first migrate its checkpoint data to the new forwarder. Checkpoint data is
internal data that the forwarder compiles to keep track of what data it has already
forwarded to an indexer. By migrating the checkpoint data, you prevent the new
universal forwarder from forwarding any data already sent by the old light
forwarder. This ensures that the same data does not get indexed twice.
You can migrate checkpoint data from an existing *nix light forwarder (version 4.0
or later) to the universal forwarder. For an overview of migration, see "Migrating
from a light forwarder" in the Deployment Overview.
Important: Migration can only occur the first time you start the universal
forwarder, post-installation. You cannot migrate at any later point.
1. Stop any services (splunkd and splunkweb, if running) for the existing
forwarder:
$SPLUNK_HOME/bin/splunk stop
Important: Make sure you install the universal forwarder into a different directory
from the existing light forwarder. Since the default install directory for the
universal forwarder is /opt/splunkforwarder and the default install directory for
full Splunk Enterprise (including the light forwarder) is /opt/splunk, you'll be safe
if you just stick with the defaults.
77
$SPLUNK_HOME/bin/splunk start
The universal forwarder will migrate the checkpoint files from the forwarder
specified in the $SPLUNK_HOME/old_splunk.seed file. Migration only occurs the
first time you run the start command. You can leave the old_splunk.seed in
place; it only gets examined the first time you start the forwarder after installing it.
Once the universal forwarder is up and running (and after you've tested to ensure
migration worked correctly), you can uninstall the old forwarder.
78
Perform advanced configuration
A single forwarder can have multiple outputs.conf files (for instance, one located
in an apps directory and another in /system/local). No matter how many
outputs.conf files the forwarder has and where they reside, the forwarder
combines all their settings, using the rules of location precedence, as described
in "Configuration file precedence". Your installation will contain both default and
custom outputs.conf files.
Default versions
Important: Do not touch default versions of any configuration files, for reasons
explained in "About configuration files".
79
Custom versions
When you configure forwarding behavior, those changes get saved in custom
versions of outputs.conf. There are several ways you can specify forwarding
behavior:
In addition to any outputs.conf files that you create and edit indirectly (for
example, through the CLI), you can also create or edit an outputs.conf file
directly. It is recommended that you work with just a single copy of the file, which
you place in $SPLUNK_HOME/etc/system/local/. (If a copy of the file already
exists in that directory, because of configuration changes made through the CLI,
just edit that copy.) For purposes of distribution and management simplicity, you
can combine settings from all non-default versions into a single custom
outputs.conf file.
After making changes to outputs.conf, you must restart the forwarder for the
changes to take effect.
For detailed information on outputs.conf, look here for the spec and examples.
80
Configuration levels
There are two types of output processors: tcpout and syslog. You can configure
them at three levels of stanzas:
• Global. At the global level, you specify any attributes that you want to
apply globally, as well as certain attributes only configurable at the
system-wide level for the output processor. This stanza is optional.
• Target group. A target group defines settings for one or more receiving
indexers. There can be multiple target groups per output processor. Most
configuration settings can be specified at the target group level.
• Single server. You can specify configuration values for single servers
(receivers) within a target group. This stanza type is optional.
Configurations at the more specific level take precedence. For example, if you
specify compressed=true for a target group, the forwarder will send the servers in
that target group compressed data, even if compressed is set to "false" for the
global level.
Note: This discussion focuses on the tcpout processor, which uses the [tcpout]
header. For the syslog output processor, see "Forward data to third-party
systems" for details.
Global stanza
Here you set any attributes that you want to apply globally. This stanza is not
required. However, there are several attributes that you can set only at the global
level, including defaultGroup and indexAndForward.
The global stanza for the tcpout procesor is specified with the [tcpout] header.
[tcpout]
defaultGroup=indexer1
indexAndForward=true
81
as well as forward the data to receiving indexers in the target groups. If set
to "false" (the default), the forwarder just forwards data but does not index
it. This attribute is only available for heavy forwarders; universal and light
forwarders cannot index data.
To set default groups for automatic forwarding, include the defaultGroup attribute
at the global level, in your [tcpout] stanza:
[tcpout]
defaultGroup= <target_group1>, <target_group2>, ...
If you do not want to forward data automatically, don't set the defaultGroup
attribute. (Prior to 4.2, you were required to set the defaultGroup to some value.
This is no longer necessary.)
For some examples of using the defaultGroup attribute, see "Route and filter
data".
The target group identifies a set of receivers. It also specifies how the forwarder
sends data to those receivers. You can define multiple target groups.
[tcpout:<target_group>]
server=<receiving_server1>, <receiving_server2>, ...
<attribute1> = <val1>
<attribute2> = <val2>
...
82
See "Define typical deployment topologies", later in this topic, for information on
how to use the target group stanza to define several deployment topologies.
Single-server stanza
When you define an attribute at the single-server level, it takes precedence over
any definition at the target group or global level.
[tcpout-server://<ipaddress_or_servername>:<port>]
<attribute1> = <val1>
<attribute2> = <val2>
...
Example
The following outputs.conf example contains three stanzas for sending tcpout to
Splunk Enterprise receivers:
[tcpout]
defaultGroup=my_indexers
[tcpout:my_indexers]
server=mysplunk_indexer1:9997, mysplunk_indexer2:9996
[tcpout-server://mysplunk_indexer1:9997]
This section shows how you can configure a forwarder to support several typical
deployment topologies. See the other topics in the "Forward data" section of this
book for information on configuring forwarders for other topologies.
83
Load balancing
To perform load balancing, specify one target group with multiple receivers. In
this example, the target group consists of three receivers:
[tcpout:my_LB_indexers]
server=10.10.10.1:9997,10.10.10.2:9996,10.10.10.3:9995
The forwarder will load balance between the three receivers listed. If one receiver
goes down, the forwarder automatically switches to the next one available.
Data cloning
To perform data cloning, specify multiple target groups, each in its own stanza.
In data cloning, the forwarder sends copies of all its events to the receivers in two
or more target groups. Data cloning usually results in similar, but not necessarily
exact, copies of data on the receiving indexers. Here's an example of how you
set up data cloning:
[tcpout]
defaultGroup=indexer1,indexer2
[tcpout:indexer1]
server=10.1.1.197:9997
[tcpout:indexer2]
server=10.1.1.200:9997
The forwarder will send duplicate data streams to the servers specified in both
the indexer1 and indexer2 target groups.
You can combine load balancing with data cloning. For example:
[tcpout]
defaultGroup=cloned_group1,cloned_group2
[tcpout:cloned_group1]
server=10.10.10.1:9997, 10.10.10.2:9997, 10.10.10.3:9997
[tcpout:cloned_group2]
server=10.1.1.197:9997, 10.1.1.198:9997, 10.1.1.199:9997,
10.1.1.200:9997
84
The forwarder will send full data streams to both cloned_group1 and
cloned_group2. The data will be load-balanced within each group, rotating
among receivers every 30 seconds (the default frequency).
Note: For syslog and other output types, you must explicitly specify routing as
described here: "Route and filter data".
The outputs.conf file provides a large number of configuration options that offer
considerable control and flexibility in forwarding. Of the attributes available,
several are of particular interest:
Where
Attribute Default Value
configured
A comma-separated list of one or
more target groups. Forwarder
sends all events to all specified
global
defaultGroup n/a target groups. Don't set this
stanza
attribute if you don't want events
automatically forwarded to a target
group.
If set to "true", the forwarder will
index all data locally, in addition to
forwarding the data to a receiving
indexer.
global
indexAndForward false
stanza
Important: This attribute is only
available for heavy forwarders. A
universal forwarder cannot index
locally.
Required. Specifies the server(s)
that will function as receivers for the
forwarder. This must be set to a
target group
server n/a value using the format
stanza
<ipaddress_or_servername>:<port>,
where <port> is the receiving
server's receiving port.
disabled false any stanza Specifies whether the stanza is
level disabled. If set to "true", it is
equivalent to the stanza not being
85
there.
global or
Specifies whether data is cooked
sendCookedData true target group
before forwarding.
stanza
global or
Specifies whether the forwarder
compressed false target group
sends compressed data.
stanza
Set of attributes for configuring
SSL. See "About securing data
any stanza from forwarders" in the Securing
ssl.... n/a
level Splunk Enterprise manual for
information on how to use these
attributes.
Specifies whether the forwarder
waits for indexer acknowledgment
global or
confirming that the data has been
useACK false target group
written to the file system. See
stanza
"Protect against loss of in-flight
data".
Specifies base time interval in
global or seconds at which indexer DNS
dnsResolutionInterval 300 target group names will be resolved to IP
stanza address. See "DNS resolution
interval".
The outputs.conf.spec file, which you can find here, along with several
examples, provides details for these and all other configuration options. In
addition, most of these settings are discussed in topics dealing with specific
forwarding scenarios.
Note: In 4.2, the persistent queue capability was much improved. It is now a
feature of data inputs and is therefore configured in inputs.conf. It is not related in
any way to the previous, deprecated persistent queue capability, which was
configured through outputs.conf. See "Use persistent queues to prevent data
loss" for details.
86
run-time interval = dnsResolutionInterval + (number of receivers in
server attribute - 1) * 30
For example, if you leave the attribute at the default setting of 300 seconds and
the forwarder is load-balancing across 20 indexers, DNS resolution will occur
every 14 minutes:
Note: Both forwarders and indexers must be version 4.2 or above for indexer
acknowledgment to function. Otherwise, the transmission will proceed without
acknowledgment.
When using forwarders to send data to peer nodes in a cluster, you should
ordinarily enable indexer acknowledgment. To learn more about forwarders and
clusters, read "Use forwarders to get your data" in the Managing Indexers and
Clusters Manual.
87
How indexer acknowledgment works when everything goes
well
3. Writes the data to the file system as events (raw data and index data).
The acknowledgment tells the forwarder that the indexer received the data and
successfully wrote it to the file system. Upon receiving the acknowledgment, the
forwarder releases the block from memory.
If the wait queue is of sufficient size, it doesn't fill up while waiting for
acknowledgments to arrive. But see this section for possible issues and ways to
address them, including how to increase the wait queue size.
When there's a failure in the round-trip process, the forwarder does not receive
an acknowledgment. It will then attempt to resend the block of data.
Why no acknowledgment?
These are the reasons that a forwarder might not receive acknowledgment:
• Indexer goes down after receiving the data -- for instance, due to machine
failure.
• Indexer is unable to write to the file system -- for instance, because the
disk is full.
• Network goes down while acknowledgment is en route to the forwarder.
88
How the forwarder deals with failure
After sending a data block, the forwarder maintains a copy of the data in its wait
queue until it receives an acknowledgment. In the meantime, it continues to send
additional blocks as usual. If the forwarder doesn't get acknowledgment for a
block within 300 seconds (by default), it closes the connection. You can change
the wait time by setting the readTimeout attribute in outputs.conf.
If the forwarder is set up for auto load balancing, it then opens a connection to
the next indexer in the group (if one is available) and sends the data to it. If the
forwarder is not set up for auto load balancing, it attempts to open a connection
to the same indexer as before and resend the data.
The forwarder maintains the data block in the wait queue until acknowledgment
is received. Once the wait queue fills up, the forwarder stops sending additional
blocks until it receives an acknowledgment for one of the blocks, at which point it
can free up space in the queue.
There are actually three conditions that can cause the forwarder to close the
network connection:
In all these cases, the forwarder will then attempt to open a connection to the
next indexer in the load-balanced group, or to the same indexer again if
load-balancing is not enabled.
It's possible for the indexer to index the same data block twice. This can happen
if there's a network problem that prevents an acknowledgment from reaching the
forwarder. For instance, assume the indexer receives a data block, parses it, and
writes it to the file system. It then generates the acknowledgment. However, on
the round-trip to the forwarder, the network goes down, so the forwarder never
receives the acknowledgment. When the network comes back up, the forwarder
89
then resends the data block, which the indexer will parse and write as if it were
new data.
To deal with such a possibility, every time the forwarder resends a data block, it
writes an event to its splunkd.log noting that it's a possible duplicate. The admin
is responsible for using the log information to track down the duplicate data on
the indexer.
You configure indexer acknowledgment on the forwarder. Set the useACK attribute
to true in outputs.conf:
[tcpout:<target_group>]
server=<server1>, <server2>, ...
useACK=true
Note: You can set useACK either globally or by target group, at the [tcpout] or
[tcpout:<target_group>] stanza levels. You cannot set it for individual receiving
indexers at the [tcpout-server: ...] stanza level.
If you want more information about the wait queue, read this section. It describes
90
how the wait queue size is configured. It also provides detailed information on
how the wait queue functions.
You do not set the wait queue size directly. Instead, you set the size of the
in-memory output queue, and the wait queue size is automatically set to three
times the output queue size. To configure the output queue size, use the
maxQueueSize attribute in outputs.conf.
The default for the maxQueueSize attribute is auto. Splunk recommends that you
keep this setting. It optimizes the queue sizes, based on whether indexer
acknowledgment is enabled:
• When useACK=true, the output queue size is 7MB and the wait queue size
is 21MB.
• When useACK=false, the output queue size is 500KB.
You can set maxQueueSize to specific values if necessary. See the outputs.conf
spec file for further details on maxQueueSize.
A wait queue can fill up when something is wrong with the network or indexer;
however, it can also fill up even when the indexer is functioning normally. This is
because the indexer only sends the acknowledgment after it has written the data
91
to the file system. Any delay in writing to the file system will slow the pace of
acknowledgment, leading to a full wait queue.
There are a few reasons that a normal functioning indexer might delay writing
data to the file system (and so delay its sending of acknowledgments):
• The indexer is very busy. For example, at the time the data arrives, the
indexer might be dealing with multiple search requests or with data
coming from a large number of forwarders.
• The indexer is receiving too little data. For efficiency, an indexer only
writes to the file system periodically -- either when a write queue fills up or
after a timeout of a few seconds. If a write queue is slow to fill up, the
indexer will wait until the timeout to write. If data is coming from only a few
forwarders, the indexer can end up in the timeout condition, even if each
of those forwarders is sending a normal quantity of data. Since write
queues exist on a per hot bucket basis, the condition occurs when some
particular bucket is getting a small amount of data. Usually this means that
a particular index is getting a small amount of data.
To ensure that throughput does not degrade because the forwarder is waiting on
the indexer for acknowledgment, you should ordinarily retain the default setting of
maxQueueSize=auto. In rare cases, you might need to increase the wait queue
size, so that the forwarder has sufficient space to maintain all blocks in memory
while waiting for acknowledgments to arrive. On the other hand, if you have
many forwarders feeding a single indexer and a moderate number of data
sources per forwarder, you might be able to conserve a few megabytes of
memory by using a smaller size.
You can also use indexer acknowledgment when the data transmission occurs
via an intermediate forwarder; that is, where an originating forwarder sends the
data to an intermediate forwarder, which then forwards it to the indexer. For this
scenario, if you want to use indexer acknowledgment, it is recommended that
you enable it along all segments of the data transmission. That way, you can
ensure that the data gets delivered along the entire path from originating
forwarder to indexer.
92
If you enable both segments of the transmission, the intermediate forwarder
waits until it receives acknowledgment from the indexer and then it sends
acknowledgment back to the originating forwarder.
However, if you enable just one of the segments, you only get indexer
acknowledgment over that part of the transmission. For example, say indexer
acknowledgment is enabled for the segment from originating forwarder to
intermediate forwarder but not for the segment from intermediate forwarder to
indexer. In this case, the intermediate forwarder sends acknowledgment back to
the originating forwarder as soon as it sends the data on to the indexer. It then
relies on TCP to safely deliver the data to the indexer. Because indexer
acknowledgment is not enabled for this second segment, the intermediate
forwarder cannot verify delivery of the data to the indexer. This second case has
limited value and is not recommended.
Besides routing to receivers, forwarders can also filter and route data to specific
queues or discard the data altogether by routing to the null queue.
Important: Only heavy forwarders can route or filter data at the event level.
Universal forwarders and light forwarders do not have the ability to inspect
individual events, but they can still forward data based on a data stream's host,
source, or source type. They can also route based on the data's input stanza, as
described below, in the subtopic, "Route inputs to specific indexers based on the
data's input".
93
This topic describes how to filter and route event data to Splunk Enterprise
instances. See "Forward data to third-party systems" in this manual for
information on routing to non-Splunk systems.
This topic also describes how to perform selective indexing and forwarding, in
which you index some data locally on a heavy forwarder and forward the
non-indexed data to one or more separate indexers. See "Perform selective
indexing and forwarding" later in this topic for details.
Configure routing
This is the basic pattern for defining most routing scenarios (using a heavy
forwarder):
1. Determine what criteria to use for routing. How will you identify categories of
events, and where will you route them?
[<spec>]
TRANSFORMS-routing=<transforms_stanza_name>
94
• <spec> can be:
♦ <sourcetype>, the source type of an event
♦ host::<host>, where <host> is the host for an event
♦ source::<source>, where <source> is the source for an event
• If you have multiple TRANSFORMS attributes, use a unique name for
each. For example: "TRANSFORMS-routing1", "TRANSFORMS-routing2",
and so on.
• <transforms_stanza_name> must be unique.
3. Edit transforms.conf to specify target groups and to set additional criteria for
routing based on event patterns:
[<transforms_stanza_name>]
REGEX=<routing_criteria>
DEST_KEY=_TCP_ROUTING
FORMAT=<target_group>,<target_group>,....
Note:
4. Edit outputs.conf to define the target group(s) for the routed data:
[tcpout:<target_group>]
server=<ip>:<port>
95
Note:
The use cases described in this topic generally follow this pattern.
In this example, a heavy forwarder filters three types of events, routing them to
different target groups. The forwarder filters and routes according to these
criteria:
[default]
TRANSFORMS-routing=errorRouting
[syslog]
TRANSFORMS-routing=syslogRouting
2. Edit transforms.conf to set the routing rules for each routing transform:
[errorRouting]
REGEX=error
DEST_KEY=_TCP_ROUTING
FORMAT=errorGroup
[syslogRouting]
REGEX=.
DEST_KEY=_TCP_ROUTING
FORMAT=syslogGroup
Note: In this example, if a syslog event contains the word "error", it will route to
syslogGroup, not errorGroup. This is due to the settings previously specified in
96
props.conf. Those settings dictated that all syslog events be filtered through the
syslogRouting transform, while all non-syslog (default) events be filtered through
the errorRouting transform. Therefore, only non-syslog events get inspected for
errors.
[tcpout]
defaultGroup=everythingElseGroup
[tcpout:syslogGroup]
server=10.1.1.197:9996, 10.1.1.198:9997
[tcpout:errorGroup]
server=10.1.1.200:9999
[tcpout:everythingElseGroup]
server=10.1.1.250:6666
This example uses data filtering to route two data streams. It forwards:
The example sends both streams as TCP. To send the second stream as syslog
data, first route the data through an indexer.
1. Edit props.conf:
[syslog]
TRANSFORMS-routing = routeAll, routeSubset
2. Edit transforms.conf:
[routeAll]
97
REGEX=(.)
DEST_KEY=_TCP_ROUTING
FORMAT=Everything
[routeSubset]
REGEX=(SYSTEM|CONFIG|THREAT)
DEST_KEY=_TCP_ROUTING
FORMAT=Subsidiary,Everything
3. Edit outputs.conf:
[tcpout]
defaultGroup=nothing
[tcpout:Everything]
disabled=false
server=10.1.12.1:9997
[tcpout:Subsidiary]
disabled=false
sendCookedData=false
server=10.1.12.2:1234
For more information, see "Forward data to third party systems" in this manual.
[source::/var/log/messages]
TRANSFORMS-null= setnull
98
2. Create a corresponding stanza in transforms.conf. Set DEST_KEY to "queue"
and FORMAT to "nullQueue":
[setnull]
REGEX = \[sshd\]
DEST_KEY = queue
FORMAT = nullQueue
Here's the opposite scenario. In this example, you use two transforms to keep
only the sshd events. One transform routes sshd events to indexQueue, while
another routes all other events to nullQueue.
Note: In this example, the order of the transforms in props.conf matters. The null
queue transform must come first; if it comes later, it will invalidate the previous
transform and route all events to the null queue.
1. In props.conf:
[source::/var/log/messages]
TRANSFORMS-set= setnull,setparsing
2. In transforms.conf:
[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue
[setparsing]
REGEX = \[sshd\]
DEST_KEY = queue
FORMAT = indexQueue
99
In props.conf:
[WinEventLog:Security]
TRANSFORMS-wmi=wminull
In transforms.conf:
[wminull]
REGEX=(?m)^EventCode=(592|593)
DEST_KEY=queue
FORMAT=nullQueue
Forwarders have a forwardedindex filter that allows you to specify whether data
gets forwarded, based on the data's target index. For example, if you have one
data input targeted to "index1" and another targeted to "index2", you can use the
filter to forward only the data targeted to index1, while ignoring the index2 data.
The forwardedindex filter uses whitelists and blacklists to specify the filtering.
For information on setting up multiple indexes, see the topic "Set up multiple
indexes".
Note: The forwardedindex filter is only applicable under the global [tcpout]
stanza. This filter does not work if it is created under any other stanza in
outputs.conf.
Default behavior
By default, the forwarder forwards data targeted for all external indexes, including
the default index and any user-created indexes. Regarding data for internal
indexes, the default behavior varies according to who is doing the forwarding:
100
• The universal forwarder forwards the data for the _audit internal index
only. It does not forward data for other internal indexes. Its default
outputs.conf file located in
$SPLUNK_HOME/etc/apps/SplunkUniversalForwarder/default specifies
that behavior with these attributes:
[tcpout]
forwardedindex.0.whitelist = .*
forwardedindex.1.blacklist = _.*
forwardedindex.2.whitelist = _audit
[tcpout]
forwardedindex.0.whitelist = .*
forwardedindex.1.blacklist = _.*
forwardedindex.2.whitelist = (_audit|_internal)
Note: The default behavior for heavy forwarders and full Splunk Enterprise
instances changed in Splunk Enterprise version 5.0.2. In earlier versions, the
_internal index was not forwarded by default. Those forwarder types had the
same behavior as the universal forwarder: only data for the _audit internal index
was forwarded.
In most deployments, you will not need to override the default settings. See
outputs.conf for more information on how to whitelist and blacklist indexes. For
more information on default and custom outputs.conf files and their locations,
see "Types of outputs.conf files".
If you want to forward all internal index data, as well as all external data, you can
override the default forwardedindex filter attributes like this:
#Forward everything
[tcpout]
forwardedindex.0.whitelist = .*
# disable these
forwardedindex.1.blacklist =
101
forwardedindex.2.whitelist =
If you want to forward only the data targeted for a single index (for example, as
specified in inputs.conf), and drop any data that's not target for that index,
here's how to do it:
[tcpout]
#Disable the current filters from the defaults outputs.conf
forwardedindex.0.whitelist =
forwardedindex.1.blacklist =
forwardedindex.2.whitelist =
This first disables all filters from the default outputs.conf file. It then sets the
filter for your own index. Be sure to start the filter numbering with 0:
forwardedindex.0.
Note: If you've set other filters in another copy of outputs.conf on your system,
you must disable those as well.
You can use the CLI btools command to ensure that there aren't any other filters
located in other outputs.conf files on your system:
This command returns the content of the tcpout stanza, after all versions of the
configuration file have been combined.
On a heavy forwarder, you can index locally. To do that, you must set
indexAndForward attribute to "true". Otherwise, the forwarder just forwards your
data and does not save it on the forwarder. On the other hand, the
forwardedindex attributes only filter forwarded data; they do not filter any data
that gets saved to the local index.
102
• If you set indexAndForward to "true" and then filter out some data through
forwardedindex blacklist attributes, the blacklisted data will not get
forwarded, but it will still get locally indexed.
• If you set indexAndForward to "false" (no local indexing) and then filter out
some data, the filtered data will get dropped entirely, since it doesn't get
forwarded and it doesn't get saved (indexed) on the forwarder.
There is one type of routing that doesn't require a heavy forwarder. In this
scenario, you use inputs.conf and outputs.conf to route data to specific
indexers, based on the data's input.
[tcpout:systemGroup]
server=server1:9997
[tcpout:applicationGroup]
server=server2:9997
[monitor://.../file1.log]
_TCP_ROUTING = systemGroup
[monitor://.../file2.log]
_TCP_ROUTING = applicationGroup
The forwarder will route data from file1.log to server1 and data from file2.log
to server2.
With a heavy forwarder only, you can index and store data locally, as well as
forward the data onwards to a receiving indexer. There are two ways to do this:
• Index all the data before forwarding it. To do this, just enable the
indexAndForward attribute in outputs.conf.
103
• Index a subset of the data before forwarding it or other data. This is
called selective indexing. With selective indexing, you can index just
some of the data locally and then forward it on to a receiving indexer.
Alternatively, you can choose to forward only the data that you don't index
locally.
To use selective indexing, you need to modify both your inputs.conf and
outputs.conf files:
1. In outputs.conf:
[indexAndForward]
index=true
selectiveIndexing=true
Note: This is a global stanza, which only needs to appear once in outputs.conf.
b. Include the usual target group stanzas for each set of receiving indexers:
[tcpout:<target_group>]
server = <ip address>:<port>, <ip address>:<port>, ...
...
2. In inputs.conf:
104
a. Add the _INDEX_AND_FORWARD_ROUTING attribute to the stanzas of each input
that you want to index locally:
[input_stanza]
_INDEX_AND_FORWARD_ROUTING=<any_string>
...
b. Add the _TCP_ROUTING attribute to the stanzas of each input that you want to
forward:
[input_stanza]
_TCP_ROUTING=<target_group>
...
The next several sections show how to use selective indexing in a variety of
scenarios.
Index one input locally and then forward the remaining inputs
In this example, the forwarder indexes data from one input locally but does not
forward it. It also forwards data from two other inputs but does not index those
inputs locally.
[tcpout]
defaultGroup=noforward
disabled=false
[indexAndForward]
index=true
selectiveIndexing=true
[tcpout:indexerB_9997]
server = indexerB:9997
105
[tcpout:indexerC_9997]
server = indexerC:9997
[monitor:///mydata/source1.log]
_INDEX_AND_FORWARD_ROUTING=local
[monitor:///mydata/source2.log]
_TCP_ROUTING=indexerB_9997
[monitor:///mydata/source3.log]
_TCP_ROUTING=indexerC_9997
• indexes the source1.log data locally but does not forward it (because
there's no explicit routing in its input stanza and there's no default group in
outputs.conf).
• forwards the source2.log data to indexerB but does not index it locally.
• forwards the source3.log data to indexerC but does not index it locally.
This example is nearly identical to the previous one. The difference is that here,
you index just one input locally, but then you forward all inputs, including the one
you've indexed locally.
[tcpout]
defaultGroup=noforward
disabled=false
[indexAndForward]
index=true
selectiveIndexing=true
[tcpout:indexerB_9997]
server = indexerB:9997
106
[tcpout:indexerC_9997]
server = indexerC:9997
[monitor:///mydata/source1.log]
_INDEX_AND_FORWARD_ROUTING=local
_TCP_ROUTING=indexerB_9997
[monitor:///mydata/source2.log]
_TCP_ROUTING=indexerB_9997
[monitor:///mydata/source3.log]
_TCP_ROUTING=indexerC_9997
The only difference from the previous example is that here, you've specified the
_TCP_ROUTING attribute for the input that you're indexing locally. The forwarder will
route both source1.log and source2.log to the indexerB_9997 target group, but it
will only locally index the data from source1.log.
Another way to index one input locally and then forward all inputs
You can achieve the same result as in the previous example by setting the
defaultGroup to a real target group.
[tcpout]
defaultGroup=indexerB_9997
disabled=false
[indexAndForward]
index=true
selectiveIndexing=true
[tcpout:indexerB_9997]
server = indexerB:9997
[tcpout:indexerC_9997]
server = indexerC:9997
107
2. In inputs.conf, create these stanzas:
[monitor:///mydata/source1.log]
_INDEX_AND_FORWARD_ROUTING=local
[monitor:///mydata/source2.log]
_TCP_ROUTING=indexerB_9997
[monitor:///mydata/source3.log]
_TCP_ROUTING=indexerC_9997
Even though you haven't set up an explicit routing for source1.log, the forwarder
will still forward it to the indexerB_9997 target group, since outputs.conf
specifies that group as the defaultGroup.
Once you enable selective indexing in outputs.conf, the forwarder will only index
locally those inputs with the _INDEX_AND_FORWARD_ROUTING attribute. This applies
to the internal logs in the /var/log/splunk directory (specified in the default
etc/system/default/inputs.conf). By default, they will not be indexed. If you
want to index them, you must add their input stanza to your local inputs.conf file
(which takes precedence over the default file) and include the
_INDEX_AND_FORWARD_ROUTING attribute:
[monitor://$SPLUNK_HOME/var/log/splunk]
index = _internal
_INDEX_AND_FORWARD_ROUTING=local
108
TCP data
To forward TCP data to a third-party system, edit the forwarder's outputs.conf file
to specify the receiving server and port. You must also configure the receiving
server to expect the incoming data stream on that port. You can use any kind of
forwarder, such as a universal forwarder, to perform this type of forwarding.
To route the data, you need to use a heavy forwarder, which has the ability to
parse data. Edit the forwarder's props.conf and transforms.conf files as well as
outputs.conf.
To route and filter the data (heavy forwarders only), also edit props.conf and
transforms.conf:
This example shows how to send all the data from a universal forwarder to a
third-party system. Since you are sending all the data, you only need to edit
outputs.conf:
[tcpout]
[tcpout:fastlane]
server = 10.1.1.35:6996
sendCookedData = false
This example shows how to use a heavy forwarder to filter a subset of data and
send the subset to a third-party system:
109
1. Edit props.conf and transforms.conf to specify the filtering criteria.
In props.conf, apply the bigmoney transform to all host names beginning with
nyc:
[host::nyc*]
TRANSFORMS-nyc = bigmoney
[bigmoney]
REGEX = .
DEST_KEY=_TCP_ROUTING
FORMAT=bigmoneyreader
[tcpout]
defaultGroup = default-clone-group-192_168_1_104_9997
[tcpout:default-clone-group-192_168_1_104_9997]
server = 192.168.1.104:9997
[tcpout:bigmoneyreader]
server=10.1.1.197:7999
sendCookedData=false
The forwarder will send all data from host names beginning with nyc to the
non-Splunk server specified in the bigmoneyreader target group. It will send data
from all other hosts to the server specified in the
default-clone-group-192_168_1_104_9997 target group.
Note: If you want to forward only the data specifically identified in props.conf
and transforms.conf, set defaultGroup=nothing.
Syslog data
You can configure a heavy forwarder to send data in standard syslog format. The
forwarder sends the data through a separate output processor. You can also filter
the data with props.conf and transforms.conf. You'll need to specify
_SYSLOG_ROUTING as the DEST_KEY.
110
Note: The syslog output processor is not available for universal or light
forwarders.
To forward syslog data, identify the third-party receiving server and specify it in a
syslog target group in the forwarder's outputs.conf file.
Note: If you have defined multiple event types for syslog data, the event type
names must all include the string "syslog".
[syslog:<target_group>]
<attribute1> = <val1>
<attribute2> = <val2>
...
Required
Default Value
Attribute
This must be in the format
<ipaddress_or_servername>:<port>. This is a
server n/a combination of the IP address or servername of the syslog
server and the port on which the syslog server is listening.
Note that syslog servers use port 514 by default.
Optional
Default Value
Attribute
The transport protocol. Must be set to "tcp" or
type udp
"udp".
priority <13> - Syslog priority. This must be an integer 1 to 3
this digits in length, surrounded by angle brackets;
signifies for example: <34>. This value will appear in the
111
a facility syslog header.
of 1
("user") Mimics the number passed via syslog interface
and a call; see outputs.conf for more information.
severity
of 5 Compute the priority value as (<facility> * 8) +
("notice") <severity>. If facility is 4 (security/authorization
messages) and severity is 2 (critical conditions),
priority value will be: (4 * 8) + 2 = 34, which you
specify in the conf file as <34>.
This must be in the format sourcetype::syslog,
syslogSourceType n/a
the source type for syslog messages.
The format used when adding a timestamp to the
header. This must be in the format:
timestampformat "" <%b %e %H:%M:%S>. See "Configure
timestamps" in the Getting Data In manual for
details.
This example shows how to configure a heavy forwarder to forward data from
hosts whose names begin with "nyc" to a syslog server named
"loghost.example.com" over port 514:
[host::nyc*]
TRANSFORMS-nyc = send_to_syslog
[send_to_syslog]
REGEX = .
DEST_KEY = _SYSLOG_ROUTING
FORMAT = my_syslog_group
112
2. In outputs.conf, define the my_syslog_group target group for the non-Splunk
server:
[syslog:my_syslog_group]
server = loghost.example.com:514
113
Heavy and light forwarders
You must first set up the receiver, as described in "Enable a receiver". You can
then set up forwarders to send data to that receiver.
To deploy a heavy forwarder, you must first install a full Splunk Enterprise
instance. For detailed information about installing Splunk Enterprise, including
system requirements and licensing issues, see the Installation manual.
Once the instance has been installed, you can enable forwarder functionality on
it.
Set up forwarding
You can use Splunk Web or the CLI as a quick way to enable forwarding in a
Splunk Enterprise instance.
114
obvious advantages to performing all forwarder configurations in a single
location. Most advanced configuration options are available only through
outputs.conf. In addition, if you will be enabling and configuring a number of
forwarders, you can easily accomplish this by editing a single outputs.conf file
and making a copy for each forwarder. See the topic "Configure forwarders with
outputs.conf" for more information.
1. Log into Splunk Web as admin on the server that will be forwarding data.
6. Click Save. You must restart the instance to complete the process.
You can use Splunk Web to perform one other configuration. To store a copy of
indexed data local to the forwarder:
2. Select Yes to store and maintain a local copy of the indexed data on the
forwarder.
Important: A heavy forwarder has a key advantage over light and universal
forwarders in that it can index your data locally, as well as forward the data to
another index. However, local indexing is turned off by default. If you want to
store data on the forwarder, you must enable that capability - either in the
manner described above or by editing outputs.conf.
115
Set up heavy forwarding with the CLI
With the CLI, setting up forwarding is a two step process. First you enable
forwarding on the Splunk Enterprise instance. Then you start forwarding to a
specified receiver.
To start forwarding activity, specify the receiver with the splunk add
forward-server command:
Note: Although this command ends forwarding activity, the instance remains
configured as a forwarder. To revert the forwarder to a full Splunk Enterprise
instance, use the disable command, as described earlier in this topic.
116
Upgrade a forwarder
To upgrade a forwarder to a new version, just upgrade the instance in the usual
fashion. For details, read the upgrade section of the Installation manual.
Important: Before doing an upgrade, consider whether you really need to. In
many cases, there's no compelling reason to upgrade a forwarder. Forwarders
are always compatible with later version indexers, so you do not need to upgrade
them just because you've upgraded the indexers they're sending data to.
Before you perform the upgrade, we strongly recommend that you back up all of
your files. Most importantly, back up your Splunk Enterprise configuration files.
For information on backing up configurations, read "Back up configuration
information" in the Admin manual.
If you're upgrading a heavy forwarder that's indexing data locally, you also need
to back up the indexed data. For information on backing up data, read "Back up
indexed data" in the Managing Indexers and Clusters manual.
You must first set up the receiver. You can then set up forwarders to send data to
that receiver.
117
2. Enable forwarding on the instance.
To deploy a light forwarder, you must first install a full Splunk Enterprise
instance. For detailed information about installing Splunk Enterprise, including
system requirements and licensing issues, see the Installation manual.
Once the instance has been installed, you can enable light forwarder functionality
on it.
Set up forwarding
With the CLI, setting up forwarding is a two step process. First you enable
forwarding on the instance. Then you start forwarding to a specified receiver.
118
splunk enable app SplunkLightForwarder -auth <username>:<password>
To start forwarding activity, specify the receiver with the splunk add
forward-server command:
Note: Although this command ends forwarding activity, the instance remains
configured as a forwarder. To revert the instance to a full Splunk Enterprise
instance, use the disable command, as described earlier in this topic.
Upgrade a forwarder
To upgrade a forwarder to a new version, just upgrade the instance in the usual
fashion. For details, read the upgrade section of the Installation manual.
Important: Before doing an upgrade, consider whether you really need to. In
many cases, there's no compelling reason to upgrade a forwarder. Forwarders
are always compatible with later version indexers, so you do not need to upgrade
them just because you've upgraded the indexers they're sending data to.
119
Back up your files first
Before you perform the upgrade, we strongly recommend that you back up all of
your files. Most importantly, back up your configuration files. For information on
backing up configurations, read "Back up configuration information" in the Admin
manual.
Note: The light forwarder has been deprecated in Splunk Enterprise version 6.0.
For a list of all deprecated features, see the topic "Deprecated features" in the
Release Notes.
The heavy forwarder has all Splunk Enterprise functions and modules enabled by
default, with the exception of the distributed search module. The file
$SPLUNK_HOME/etc/apps/SplunkForwarder/default/default-mode.conf includes
this stanza:
[pipeline:distributedSearch]
disabled = true
For a detailed view of the exact configuration, see the configuration files for the
SplunkForwarder application in
$SPLUNK_HOME/etc/apps/SplunkForwarder/default.
120
• Disables all indexing
($SPLUNK_HOME/etc/apps/SplunkLightForwarder/default/indexes.conf).
• Does not use transforms.conf and does not fully parse incoming data,
but the CHARSET, CHECK_FOR_HEADER, NO_BINARY_CHECK,
PREFIX_SOURCETYPE, and sourcetype properties from props.conf are used.
• Disables the Splunk Web interface
($SPLUNK_HOME/etc/apps/SplunkLightForwarder/default/web.conf ).
• Limits throughput to 256KBps
($SPLUNK_HOME/etc/apps/SplunkLightForwarder/default/limits.conf).
• Disables the following modules in
$SPLUNK_HOME/etc/apps/SplunkLightForwarder/default/default-mode.conf:
[pipeline:indexerPipe]
disabled_processors= indexandforward, diskusage,
signing,tcp-output-generic-processor, syslog-output-generic-processor,
http-output-generic-processor, stream-output-processor
[pipeline:distributedDeployment]
disabled = true
[pipeline:distributedSearch]
disabled = true
[pipeline:fifo]
disabled = true
[pipeline:merging]
disabled = true
[pipeline:typing]
disabled = true
[pipeline:udp]
disabled = true
[pipeline:tcp]
disabled = true
[pipeline:syslogfifo]
disabled = true
[pipeline:syslogudp]
disabled = true
[pipeline:parsing]
disabled_processors=utf8, linebreaker, header, sendOut
[pipeline:scheduler]
121
disabled_processors = LiveSplunks
These modules include the deployment server (not the deployment client),
distributed search, named pipes/FIFOs, direct input from network ports, and the
scheduler.
The defaults for the light forwarder can be tuned to meet your needs by
overriding the settings in
$SPLUNK_HOME/etc/apps/SplunkLightForwarder/default/default-mode.conf on
a case-by-case basis.
When you convert an indexer instance to a light forwarder, among other things,
you disable indexing. In addition, you no longer have access to any data
previously indexed on that instance. However, the data still exists.
If you want to purge that data from your system, you must first disable the
SplunkLightForwarder app, then run the CLI clean command, and then renable
the app. For information on the clean command, see "Remove indexed data from
Splunk" in the Managing Indexers and Clusters manual.
122
Troubleshoot forwarding
If the internal queue on the receiving indexer gets blocked, the indexer shuts
down the receiving/listening (splunktcp) port after a specified interval of being
unable to insert data into the queue. Once the queue is again able to start
accepting data, the indexer reopens the port.
If you find you have this issue, you can set the receiver's
stopAcceptorAfterQBlock attribute in inputs.conf to a higher value, so that it
does not close the port as quickly. This attribute determines the amount of time
the indexer waits before closing the port. The default is 300 seconds (five
minutes).
If you are using load-balanced forwarders, they will switch their data stream to
another indexer in the load-balanced group based to their time-out interval, set in
outputs.conf with the writeTimeout attribute. This results in automatic failover
when the receiving indexers have blocked queues.
123