Splunk Architect Exercises

← Back to the handbook
Work these by hand first, then open the solution to check yourself. They move from warm-up to design-level. Some are numeric, some ask you to write config, and some are scenarios where you decide what to do. Solutions show the reasoning, not just the answer.

Configuration and precedence

EXERCISE 1Warm-up

The same setting for a sourcetype appears in etc/apps/myapp/default/props.conf and in etc/apps/myapp/local/props.conf. Which value wins, and how do you prove it?

Show solution

The value in local wins, because for the same app, local overrides default. Prove it by running:

./splunk btool props list <sourcetype> --debug

The --debug flag prints the source file next to each winning setting, so you can see the local file is the one being used.

EXERCISE 2Warm-up

A colleague edited a setting in etc/apps/search/default/limits.conf and it disappeared after an upgrade. What went wrong and what should they have done?

Show solution

They edited the default folder, which the upgrade replaced. The fix is to put the change in etc/apps/search/local/limits.conf instead. Local folders are yours and survive upgrades; default folders belong to the vendor.

Getting data in

EXERCISE 3Core

Write the inputs to collect the Windows Security and System event logs on a universal forwarder, sending Security to index win_security and System to win_os.

Show solution
# inputs.conf on the Windows universal forwarder
[WinEventLog://Security]
disabled = 0
index = win_security

[WinEventLog://System]
disabled = 0
index = win_os

Make sure both indexes exist on the indexers, and that the forwarder has an outputs.conf pointing at them.

EXERCISE 4Core

You must drop all events containing healthcheck from sourcetype web_access before they are indexed. Write the config and say which machine it belongs on.

Show solution

This is index-time filtering, so it belongs on the indexers or a heavy forwarder, not a universal forwarder.

# transforms.conf
[drop_healthcheck]
REGEX = healthcheck
DEST_KEY = queue
FORMAT = nullQueue
# props.conf
[web_access]
TRANSFORMS-drop = drop_healthcheck
EXERCISE 5Core

From sourcetype app_log, keep only lines containing ERROR or FATAL, and drop the rest. Write the transforms in the correct order.

Show solution

Route everything to null first, then route the keepers back to the index queue. The last matching transform wins, so order matters.

# transforms.conf
[set_null]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[keep_errors]
REGEX = (ERROR|FATAL)
DEST_KEY = queue
FORMAT = indexQueue
# props.conf
[app_log]
TRANSFORMS-filter = set_null, keep_errors
EXERCISE 6Core

Card numbers appear in sourcetype payments. Mask all but the last four digits before indexing. Where does this run?

Show solution

Index-time masking runs on the indexers or a heavy forwarder. Use SEDCMD:

# props.conf
[payments]
SEDCMD-mask = s/\d{12}(\d{4})/xxxxxxxxxxxx\1/g

Set this before the source goes live. Masking cannot clean data that is already indexed.

Clustering and availability

EXERCISE 7Core

An indexer cluster has replication factor 3 and search factor 2. How many peers can fail at once without losing data, and without losing searchability?

Show solution

Data survives the loss of replication factor minus 1 peers, which is 2. Full searchability survives the loss of search factor minus 1 peers, which is 1, after which the cluster rebuilds searchable copies from the remaining raw copies. So it can lose 2 peers without losing data, and 1 peer without any gap in searchable copies.

EXERCISE 8Core

You want a search head cluster that can lose one member and keep working. What is the smallest sensible member count, and why not two?

Show solution

Three members. The captain is chosen by majority vote, so you need an odd number that can still form a majority after a loss. With two members, losing one leaves a single member that cannot hold a majority, so the cluster cannot safely elect a captain. Three survives one loss and keeps a majority of two.

EXERCISE 9Advanced

Put the search head cluster setup steps in order: bootstrap the captain, set the deployer secret, init each member, push apps. Name the machine for each.

Show solution

1. Set the deployer secret and label in server.conf on the deployer, then restart it.
2. Run init shcluster-config on each member, then restart each.
3. Run bootstrap shcluster-captain on one member, listing all members.
4. Push apps with apply shcluster-bundle from the deployer.

The order matters because members must be initialised before the cluster can be bootstrapped, and the deployer must be ready before you push apps.

EXERCISE 10Advanced

A site outage leaves your six-member search head cluster with only two members reachable. Searches have stopped because no captain can be elected. What do you do, and what do you undo later?

Show solution

Configure a static captain so the survivors can work. On one healthy member:

./splunk edit shcluster-config -election false -mode captain \
    -captain_uri https://sh1:8089 -auth admin:pass

On the other reachable member:

./splunk edit shcluster-config -election false -mode member \
    -captain_uri https://sh1:8089 -auth admin:pass

When enough members return to form a majority, turn election back on with -election true on every member and restart, so the cluster manages the captain dynamically again.

Static captain does not fail over on its own. It is a recovery tool, not a normal running mode. Confirm the exact flags against your version's docs and practice in a lab first.
EXERCISE 11Advanced

You need to add a fourth member to an existing three-member search head cluster. What is the risk, and what are the steps?

Show solution

The risk: joining an instance to the cluster overwrites its existing apps and config with the cluster's. Do not add a search head that holds content you need unless that content is already in the deployer.

Steps: initialise the new instance with init shcluster-config using the same settings as the others and restart it, then join it. From the new member:

./splunk add shcluster-member -current_member_uri https://sh1:8089 -auth admin:pass

Going from three to four makes the count even, so plan to reach five, or be aware that an even count is less ideal for election.

Sizing and design

EXERCISE 12Core

Assume for this exercise that one indexer at your chosen spec can handle 100 GB of ingest per day while also serving searches. You ingest 640 GB per day at peak. How many indexers for ingest alone, before any clustering or headroom?

Show solution

640 divided by 100 is 6.4, so you need 7 indexers to cover peak ingest, since you round up. This is ingest capacity only. You would then add indexers for search concurrency and for headroom, and account for replication overhead if you cluster. The 100 GB figure here is an assumption for the exercise, not a fixed Splunk value; always use the real per-indexer capacity for your spec and workload.

EXERCISE 13Core

You ingest 200 GB per day and must keep it searchable for 30 days. Ignoring replication, roughly how do you estimate the on-disk size, and what extra factor does clustering add?

Show solution

Estimate stored size as daily volume times retention days, adjusted for compression and index overhead. Raw data usually compresses well, but the index files add some of that back, so architects often plan using a total on-disk figure per day rather than the raw log size. For 30 days at 200 GB per day of raw data, start from 6 TB of raw and apply your measured on-disk ratio for that data. Clustering then multiplies this by the replication factor, because each bucket is stored that many times, plus extra for searchable copies. So a replication factor of 3 roughly triples the disk. Measure your own compression ratio rather than assuming one.

EXERCISE 14Advanced

A team keeps adding indexers only because they are running out of disk, not because they need more compute. What design option addresses this, and how does it change sizing?

Show solution

SmartStore. It keeps the master copy of data in cheap remote object storage and uses local disk as a cache for the working set. This decouples storage from compute, so the team grows object storage for capacity and adds indexers only when they need more ingest or search power. Sizing shifts from sizing local disk for all retained data to sizing the cache for the data searches actually touch, plus sizing the object store for total retention.

EXERCISE 15Advanced

Design a deployment for a business that ingests a large volume daily, cannot lose data, must stay searchable if one server fails, and has many analysts. Sketch the tiers and the management nodes.

Show solution

Use a clustered distributed design:

An indexer cluster with enough peers for peak ingest plus search plus headroom, replication factor at least 3 and search factor 2 so it survives a peer loss. A search head cluster of at least three members for the analysts and availability. A forwarder tier of universal forwarders feeding the peers, managed by a deployment server.

Management nodes, each kept off the data nodes: a cluster manager for the indexer cluster, a deployer for the search head cluster, a central license manager, and a Monitoring Console. Consider SmartStore if storage growth will outpace compute.

Operations and troubleshooting

EXERCISE 16Core

A universal forwarder is installed but no data is arriving in Splunk. List the checks in order.

Show solution

1. On the forwarder, confirm the input exists: ./splunk list monitor.
2. On the forwarder, confirm it points at the indexers: ./splunk list forward-server.
3. On the indexer, confirm the receiving port is enabled: check ./splunk display listen or that [splunktcp://9997] is set.
4. Confirm the target index exists on the indexers.
5. Read splunkd.log on both sides, or search index=_internal, for connection errors such as a blocked port.
6. Confirm the network path and firewall allow the forwarder to reach 9997.

EXERCISE 17Core

A setting you added is not taking effect. What single command tells you which file is actually winning, and what flag do you need?

Show solution
./splunk btool <conf> list <stanza> --debug

The --debug flag is the key part. It prints the exact file each winning setting came from, so you can spot a higher-precedence copy overriding yours, or find that your setting is on the wrong tier.

EXERCISE 18Advanced

You must restart every peer in a busy production indexer cluster to apply a change. How do you do it without an outage?

Show solution

Do not restart all peers at once. Push the change as a bundle from the cluster manager, and use the rolling restart action so peers restart one at a time while the others keep the data available. Let the cluster return to a healthy state between restarts. Check status with ./splunk show cluster-status on the manager before and after.

Splunk Architect Handbook exercises. Verify version-specific commands and figures against the docs for your build.