Splunk
Search and visualize compact events in Splunk; the original lines of each event up to 256 KB expand back exactly at search time. This open-source app expands compact events at search time: classic dashboards keep their panels unchanged, a search puts the tx macro in front of its terms, and an alert created in the app's Compile Alert view compiles once so the scheduler runs it natively.
Use the Reporter (DaemonSet, pre-ingestion) or the MCP server's SIEM-sample tool (agentless, via Splunk REST API) to identify optimization opportunities in your existing Splunk data.
Analytics Dashboard
The Analytics dashboard shows compact event counts, active templates, compression ratio and storage saved. It finds compact events through the tenx-events macro.
| Panel | Description |
|---|---|
| Total Encoded Events | Compact events indexed |
| Active Templates | Templates in the KV Store |
| Compression Ratio | Original size over compact size, on the latest 5,000 events |
| Estimated Storage Savings | Bytes saved and percentage reduction, on the latest 10,000 events |
| Event Volume, Last 7 Days | Compact events per hour |
| Top 10 Templates by Usage | Template hashes with the most events |
| Inflation Success Rate | Share of the latest 1,000 events that expand |
How It Works
A compact event carries a template hash and the event's variable values. The app reads the template hash into the field tenx_hash; in the engine's metrics, the label of that name holds the pattern hash. The constant words live in the KV Store, so the app puts them back at search time and re-applies the search to the expanded lines.
A word that exists only in a template is not in the index, so a plain keyword search over compact data finds the events where the word is a value and misses the others. To search by what the lines say, write the app's tx macro in front of the search terms, after the index and any time terms. It runs as native SPL in the search bar, Dashboard Studio panels, saved searches and alerts: it selects the compact events that can match, expands them, and applies the search to the original lines. Classic dashboards keep their panels unchanged: the browser sends each panel's search to the app, which rewrites it on the server. An alert created in the Compile Alert view compiles once and then runs as an ordinary saved search.
The Receiver compacts each record's log message and leaves its other fields, such as the Kubernetes namespace, pod and container, as they arrived. The forwarder sends the compact message as the Splunk event and those fields as indexed fields, so they stay searchable by name and in tstats without the app. The splunk-app README covers the Receiver settings the app needs.
Ingestion Flow
The Receiver compacts events at the edge, and Splunk ingests them into Splunk with reduced payload size:
graph LR
A["<div style='font-size: 14px;'>🗜️ Compact</div><div style='font-size: 10px;'>Compact Events</div>"] --> B["<div style='font-size: 14px;'>📡 Ingest</div><div style='font-size: 10px;'>HEC</div>"]
B --> C["<div style='font-size: 14px;'>📋 KV Store</div><div style='font-size: 10px;'>Templates</div>"]
B --> D["<div style='font-size: 14px;'>💾 Index</div><div style='font-size: 10px;'>Encoded</div>"]
classDef edge fill:#7c3aed88,stroke:#6d28d9,color:#ffffff,stroke-width:2px,rx:8,ry:8
classDef ingest fill:#9333ea88,stroke:#7c3aed,color:#ffffff,stroke-width:2px,rx:8,ry:8
classDef store fill:#2563eb88,stroke:#1d4ed8,color:#ffffff,stroke-width:2px,rx:8,ry:8
class A edge
class B ingest
class C,D store
🗜️ Compact: Receiver (Compact mode) compacts events, extracting repetitive patterns into templates
📡 Ingest: the forwarder sends compact events and templates to Splunk over HEC
📋 KV Store: Templates stored in tenx_dml collection for lookup at search time
💾 Index: compact events, each a template hash and its values, with the record's metadata as indexed fields
Search Flow
Two paths reach the same rewrite, then expand the events:
graph LR
E["<div style='font-size: 14px;'>📊 Dashboard</div><div style='font-size: 10px;'>Panel SPL</div>"] --> F["<div style='font-size: 14px;'>🪝 Hook</div><div style='font-size: 10px;'>Intercept</div>"]
E2["<div style='font-size: 14px;'>👤 Search Bar</div><div style='font-size: 10px;'>tx</div>"] --> G
F --> G["<div style='font-size: 14px;'>🔄 Transform</div><div style='font-size: 10px;'>Prefilter + Macro</div>"]
G --> H["<div style='font-size: 14px;'>📖 Expand</div><div style='font-size: 10px;'>Expand</div>"]
H --> I["<div style='font-size: 14px;'>📊 Results</div><div style='font-size: 10px;'>Full Data</div>"]
classDef user fill:#059669,stroke:#047857,color:#ffffff,stroke-width:2px,rx:8,ry:8
classDef hook fill:#f59e0b,stroke:#d97706,color:#ffffff,stroke-width:2px,rx:8,ry:8
classDef result fill:#ea580c88,stroke:#c2410c,color:#ffffff,stroke-width:2px,rx:8,ry:8
class E,E2 user
class F,G hook
class H,I result
📊 Dashboard: dashboard.js loads on every classic dashboard in the app carrying it and points the panel's search at the app's REST endpoint, via $.ajaxSetup
👤 Search Bar: `tx` in front of the search terms runs a one-row command that reads the search and looks its words up in the templates; the same search works in Dashboard Studio panels, saved searches and alerts
🔄 Transform: each search word is resolved against the templates, and the SPL becomes a hash prefilter plus the tenx-inflate macro
📖 Expand: the macro joins compact events with templates from the KV Store
📊 Results: fully expanded events, with the original search re-applied so only true matches remain
Scheduled alerts run server-side, where the browser hook never fires. An alert created in the Compile Alert view, or through the /tenx-alert endpoint, is compiled once at save time into a native saved search (a template-hash prefilter plus the tenx-inflate macro), so the scheduler runs an ordinary search with no per-run proxy. The Compile Alert view and the /tenx-alert endpoint handle this, and a recompile pass converts | tx and | tenxsearch alerts to native form and refreshes their prefilters as new templates appear. See SAVE_TIME_ALERTS.md.
Quickstart
Get encoded events flowing to Splunk in under 15 minutes.
Step 1: Install Splunk App
Clone the repository and install to your Splunk apps directory:
git clone https://github.com/log-10x/splunk-app.git
cp -r splunk-app/tenx-for-splunk $SPLUNK_HOME/etc/apps/
$SPLUNK_HOME/bin/splunk restart
In a distributed deployment, install the app on the search heads and on the indexers or heavy forwarders that parse the compact events, where it sets each event's _time.
Prerequisites:
| Requirement | Description |
|---|---|
| Splunk Enterprise | 9.4 through 10.6 (bundled Python 3.9 through 3.13) |
| Admin Access | Required for app installation and KV Store setup |
Verify Installation
After restart, confirm the app appears in Splunk:
- Navigate to Apps → Manage Apps
- Search for "10x"; the list shows Log10x App
- Click the app name to open the Analytics dashboard
Step 2: Create HEC Tokens
Create two HTTP Event Collector tokens in Splunk: one for templates, one for encoded events.
Navigate to HEC Settings:
- Go to Settings → Data inputs → HTTP Event Collector
- Click Global Settings and ensure HEC is Enabled
- Note the HTTP Port Number (default: 8088)
Create Templates Token:
| Setting | Value |
|---|---|
| Name | tenx-templates |
| Source type | tenx_dml_raw_json |
| Index | tenx_dml |
| Enable indexer acknowledgement | Off |
Create Encoded Events Token:
| Setting | Value |
|---|---|
| Name | tenx-encoded |
| Source type | tenx_encoded |
| Index | Your target index |
| Enable indexer acknowledgement | Off |
The app recognizes compact events by their sourcetype. To use a sourcetype other than tenx_encoded, add the app's extraction to that sourcetype's props.conf stanza:
Point tx and the dashboards at these events
The tx macro and the app's Analytics and Diagnostics dashboards find compact events through the tenx-events search macro, which defaults to index=* (sourcetype::tenx_encoded OR tenx_sourcetype::*). Set it to your index under Settings → Advanced search → Search macros, and keep the sourcetype in the indexed form sourcetype::, for example index=my_compact_index (sourcetype::tenx_encoded OR tenx_sourcetype::*).
Create Index First
If tenx_dml index doesn't exist, create it via Settings → Indexes → New Index before creating the token.
Step 3: Configure Forwarder
Give the Receiver receiverOptimize true, which turns compaction on, and the three options below, on its command line after @apps/receiver, as each tab does. A value given after @apps/receiver replaces the one in the app's configuration. Each of the three keeps expansion exact:
| Option | Value | Why |
|---|---|---|
varMaxRecurIndexes |
0 |
Every variable value travels in the event |
timestampZone |
UTC |
The app renders timestamps in UTC |
timestampMaxPerObject |
1 |
The app stores one timestamp format per template |
A template that breaks the first or third rule stays compact and carries tenx_expand_refused, naming the reason.
Give it groupJoinLines false as well, so that each forwarder record is one Splunk event.
For the app's txf macro, the sender also gives each compact event the indexed field tenx_sourcetype, its original sourcetype, as Fields of the Original Sourcetype describes.
Configure your log forwarder to send encoded events and templates to Splunk. Where Universal Forwarders send to a heavy forwarder, run the Receiver beside the heavy forwarder instead, with no HTTP Event Collector.
Start from the Fluent Bit overlay in Deploy, and add receiverOptimize true varMaxRecurIndexes 0 timestampZone UTC timestampMaxPerObject 1 groupJoinLines false to the sidecar's arguments, after @apps/receiver. In that overlay, set Merge_Log Off in the kubernetes filter (and remove Keep_Log Off), so a JSON log line stays in log, where the Receiver compacts it. Then replace the [OUTPUT] block that writes tenx.* to stdout: the filter below goes under filters: and the two outputs under outputs:.
Each record returns from the Receiver with tenx. in front of its tag. Its log value is compact and its other fields are unchanged. The events output sends the compact message as the Splunk event and the Kubernetes metadata as indexed fields.
# Lift the Kubernetes metadata to top-level keys the output can name.
[FILTER]
Name nest
Match_Regex ^tenx\.(?!tenx-template).*
Operation lift
Nested_under kubernetes
Add_prefix k8s_
# Templates: one record per new template, for the KV Store.
[OUTPUT]
Name splunk
Match tenx.tenx-template
Host your-splunk-host.com
Port 8088
Splunk_Token YOUR_TEMPLATES_HEC_TOKEN
event_index tenx_dml
event_source fluent-bit-tenx
event_sourcetype tenx_dml_raw_json
TLS On
TLS.Verify On
Retry_Limit False
# Compact events: the message as the event, the metadata as indexed fields.
# The Receiver's connection notice (tag tenx-stdout) matches no output and is dropped.
[OUTPUT]
Name splunk
Match_Regex ^tenx\.(?!tenx-template|tenx-stdout).*
Host your-splunk-host.com
Port 8088
Splunk_Token YOUR_ENCODED_EVENTS_HEC_TOKEN
event_index your_logs_index
event_sourcetype tenx_encoded
event_key $log
event_field stream $stream
event_field k8s_namespace_name $k8s_namespace_name
event_field k8s_pod_name $k8s_pod_name
event_field k8s_pod_id $k8s_pod_id
event_field k8s_container_name $k8s_container_name
event_field k8s_container_image $k8s_container_image
event_field k8s_docker_id $k8s_docker_id
event_field k8s_host $k8s_host
TLS On
TLS.Verify On
Retry_Limit False
A record key reaches Splunk only through event_key or an event_field line. To keep pod labels, add a second nest filter with Nested_under k8s_labels and Add_prefix k8s_label_, then an event_field line for each label you search on.
Match the returning tags
Both outputs match tags that start with tenx., the prefix the overlay's egress input adds. An output that matches the original tags sends records that never passed through the Receiver, and one that matches tenx-template without the prefix misses the templates, so no event expands.
Without Kubernetes, two Fluent Bit processes and the Receiver run as three containers that share one network. The first Fluent Bit reads the logs and sends each source's records to the Receiver on port 24224. The second takes them back on port 24225, with tenx. in front of each tag, and sends them to Splunk. Each process keeps what it holds on disk, in a storage.path of its own. The events output matches the sources' own tags, tenx.src.*, so it leaves out the template records and the Receiver's connection notice (tenx.tenx-stdout).
# What the tail input has read waits on disk, not in memory.
[SERVICE]
HTTP_Server On
HTTP_Port 2020
storage.path /logs/flb-storage
# One tail input per log file, each tagged src.<name>.
[INPUT]
Name tail
Path /logs/app.log
DB /logs/app.log.db
Tag src.app
Read_from_Head true
storage.type filesystem
# The sources' records, to the Receiver.
[OUTPUT]
Name forward
Match src.*
Host 127.0.0.1
Port 24224
Retry_Limit False
# What waits to be sent to Splunk waits on disk, not in memory.
[SERVICE]
HTTP_Server On
HTTP_Port 2021
storage.path /logs/flb-storage-back
# The records back from the Receiver, tagged tenx.<original tag>.
[INPUT]
Name forward
Listen 0.0.0.0
Port 24225
Tag_Prefix tenx.
storage.type filesystem
# Templates: one record per new template, for the KV Store.
[OUTPUT]
Name splunk
Match tenx.tenx-template
Host your-splunk-host.com
Port 8088
Splunk_Token YOUR_TEMPLATES_HEC_TOKEN
event_index tenx_dml
event_source fluent-bit-tenx
event_sourcetype tenx_dml_raw_json
TLS On
TLS.Verify On
Retry_Limit False
# Compact events: the message as the event.
[OUTPUT]
Name splunk
Match tenx.src.*
Host your-splunk-host.com
Port 8088
Splunk_Token YOUR_ENCODED_EVENTS_HEC_TOKEN
event_index your_logs_index
event_sourcetype tenx_encoded
event_key $log
TLS On
TLS.Verify On
Retry_Limit False
A test instance with Splunk's default self-signed certificate needs TLS.Verify Off in both splunk outputs.
Create the indexes the events go to and restart the indexers before the first event is sent. The search below returns no row once every indexer has loaded them.
index=_internal sourcetype=splunkd component=IndexerService "unconfigured/disabled/deleted index" | stats count by host
Start the Fluent Bit that sends to Splunk, then the Receiver with its five arguments and the Fluent Bit that reads the logs, both in its network. <network> is a Docker network from which the HTTP Event Collector is reachable, and <log folder> holds the files the tail inputs read and both processes' buffers.
docker run -d --name tenx-fluentbit-back --network <network> \
-v <fluent-bit-back.conf>:/fluent-bit/etc/fluent-bit.conf:ro -v <log folder>:/logs fluent/fluent-bit:5.1.5
docker run -d --name tenx-receiver --network container:tenx-fluentbit-back log10x/edge-10x:1.1.183 \
@run/input/forwarder/fluentbit @apps/receiver receiverOptimize true varMaxRecurIndexes 0 \
timestampZone UTC timestampMaxPerObject 1 groupJoinLines false
docker run -d --name tenx-fluentbit --network container:tenx-fluentbit-back \
-v <fluent-bit.conf>:/fluent-bit/etc/fluent-bit.conf:ro -v <log folder>:/logs fluent/fluent-bit:5.1.5
The Receiver and the Fluent Bit that reads the logs run in the network of the one that sends to Splunk, so restart both after each restart of it. With Retry_Limit False, the Fluent Bit that reads the logs keeps the records it reads in the meantime and sends them when the Receiver is back.
Start from the Fluentd overlay in Deploy, and add receiverOptimize true varMaxRecurIndexes 0 timestampZone UTC timestampMaxPerObject 1 groupJoinLines false to the sidecar's arguments, after @apps/receiver. In that overlay, replace the @OUTPUT label in 04_outputs.conf with the one below. It sends to the HTTP Event Collector with Fluentd's built-in http output, so the Fluentd image needs no extra plugin.
Templates return tagged tenx-template. Every other record keeps its tag, with its log value compact and its other fields unchanged.
<label @OUTPUT>
# Templates: one record per new template, for the KV Store.
<filter tenx-template>
@type record_transformer
enable_ruby true
renew_record true
<record>
event ${{"templateHash" => record["templateHash"], "template" => record["template"]}}
index tenx_dml
sourcetype tenx_dml_raw_json
source fluentd-tenx
</record>
</filter>
<match tenx-template>
@type http
endpoint https://your-splunk-host.com:8088/services/collector/event
headers "{\"Authorization\":\"Splunk YOUR_TEMPLATES_HEC_TOKEN\"}"
<format>
@type json
</format>
<buffer>
flush_mode interval
flush_interval 2s
chunk_limit_size 1m
retry_forever true
</buffer>
</match>
# The Receiver's connection notice: discard it.
<match tenx-stdout>
@type null
</match>
# HEC rejects a whole batch that contains an empty event.
<filter **>
@type grep
<regexp>
key log
pattern /./
</regexp>
</filter>
# Compact events: the message as the event, the metadata as indexed fields.
<filter **>
@type record_transformer
enable_ruby true
renew_record true
<record>
event ${record["log"]}
host ${hostname}
index your_logs_index
sourcetype tenx_encoded
fields ${{"tenx_sourcetype" => record["tenx_sourcetype"], "stream" => record["stream"], "k8s_namespace_name" => record.dig("kubernetes", "namespace_name"), "k8s_pod_name" => record.dig("kubernetes", "pod_name"), "k8s_container_name" => record.dig("kubernetes", "container_name"), "k8s_container_image" => record.dig("kubernetes", "container_image"), "k8s_host" => record.dig("kubernetes", "host")}.compact}
</record>
</filter>
<match **>
@type http
endpoint https://your-splunk-host.com:8088/services/collector/event
headers "{\"Authorization\":\"Splunk YOUR_ENCODED_EVENTS_HEC_TOKEN\"}"
<format>
@type json
</format>
<buffer>
flush_mode interval
flush_interval 2s
chunk_limit_size 1m
retry_forever true
</buffer>
</match>
</label>
A record key reaches Splunk only through event or fields. Add an entry to fields for each further key you search on. Fluentd writes its configuration to its own log when it starts, and the http output does not mask headers there; set suppress_config_dump true in Fluentd's <system> section to keep the tokens out of that log.
A test instance with Splunk's default self-signed certificate needs tls_verify_mode none in both http outputs.
Start from the OTel Collector overlay in Deploy, and add receiverOptimize true varMaxRecurIndexes 0 timestampZone UTC timestampMaxPerObject 1 groupJoinLines false to the sidecar's arguments, after @apps/receiver. Run a Collector image that carries the transform processor and the Splunk HEC exporter, such as otel/opentelemetry-collector-contrib. Then replace the overlay's logs/from-tenx pipeline with the one below.
Each record returns from the Receiver with its body compact and its attributes unchanged. Templates return as records with no body and the attributes templateHash, template and tenx_tag = tenx-template. The processor gives each compact event the indexed field tenx_time=sender, so the app keeps the time the Collector gave it, and removes com.splunk.sourcetype, which the exporter would take over tenx_encoded. It sends each template to tenx_dml as tenx_dml_raw_json, with the template as its event. Enrichment stays on the ingest pipeline.
config:
processors:
transform/splunk:
error_mode: ignore
log_statements:
- context: resource
statements:
- 'delete_key(attributes, "com.splunk.sourcetype")'
- context: log
statements:
- 'delete_key(attributes, "com.splunk.sourcetype") where attributes["tenx_tag"] == nil'
- 'set(attributes["tenx_time"], "sender") where attributes["tenx_tag"] == nil'
- 'set(body, {"templateHash": attributes["templateHash"], "template": attributes["template"]}) where attributes["tenx_tag"] == "tenx-template"'
- 'set(attributes["com.splunk.index"], "tenx_dml") where attributes["tenx_tag"] == "tenx-template"'
- 'set(attributes["com.splunk.sourcetype"], "tenx_dml_raw_json") where attributes["tenx_tag"] == "tenx-template"'
- 'keep_keys(attributes, ["com.splunk.index", "com.splunk.sourcetype"]) where attributes["com.splunk.sourcetype"] == "tenx_dml_raw_json"'
exporters:
splunk_hec:
endpoint: "https://your-splunk-host.com:8088/services/collector"
token: "YOUR_ENCODED_EVENTS_HEC_TOKEN"
index: your_logs_index
sourcetype: tenx_encoded
service:
pipelines:
logs/from-tenx:
receivers: [otlp/tenx]
processors: [transform/splunk]
exporters: [splunk_hec]
The exporter sends the compact body as the Splunk event and the other attributes of the record and its resource as indexed fields. Its token must allow the tenx_dml index as well as your logs index.
A test instance with Splunk's default self-signed certificate needs tls: insecure_skip_verify: true on the splunk_hec exporter.
Start from the Vector overlay in Deploy. Add receiverOptimize true varMaxRecurIndexes 0 timestampZone UTC timestampMaxPerObject 1 groupJoinLines false to the sidecar's arguments, after @apps/receiver, and replace the overlay's destinations sink with the route and the two splunk_hec_logs sinks below.
customConfig:
transforms:
ret:
type: route
inputs: [tenx_out]
route:
tpl: '.tag == "tenx-template"'
ev: '.tag != "tenx-template" && .tag != "tenx-stdout" && is_string(.message)'
sinks:
# Templates: one record per new template, for the KV Store.
hec_tpl:
type: splunk_hec_logs
inputs: [ret.tpl]
endpoint: "https://your-splunk-host.com:8088"
default_token: "YOUR_TEMPLATES_HEC_TOKEN"
index: tenx_dml
sourcetype: "tenx_dml_raw_json"
encoding:
codec: json
only_fields: [templateHash, template]
source: "vector-tenx"
acknowledgements:
indexer_acknowledgements_enabled: false
buffer:
type: disk
max_size: 268435488
when_full: block
# Compact events: the message as the event.
hec_ev:
type: splunk_hec_logs
inputs: [ret.ev]
endpoint: "https://your-splunk-host.com:8088"
default_token: "YOUR_ENCODED_EVENTS_HEC_TOKEN"
index: your_logs_index
sourcetype: "tenx_encoded"
encoding:
codec: text
indexed_fields: [tenx_sourcetype]
acknowledgements:
indexer_acknowledgements_enabled: false
buffer:
type: disk
max_size: 268435488
when_full: block
Start from the Logstash overlay in Deploy, add receiverOptimize true varMaxRecurIndexes 0 timestampZone UTC timestampMaxPerObject 1 groupJoinLines false to the sidecar's arguments, after @apps/receiver, and in that overlay replace the output of tenx-destinations.conf with the one below, whose http outputs build each HEC event with mapping.
output {
if [templateHash] {
# Templates: one record per new template, for the KV Store.
http {
url => "https://your-splunk-host.com:8088/services/collector/event"
http_method => "post"
format => "json"
headers => ["Authorization", "Splunk YOUR_TEMPLATES_HEC_TOKEN"]
mapping => { "event" => { "templateHash" => "%{templateHash}" "template" => "%{template}" } "index" => "tenx_dml" "sourcetype" => "tenx_dml_raw_json" "source" => "logstash-tenx" }
}
} else {
# Compact events: the message as the event.
http {
url => "https://your-splunk-host.com:8088/services/collector/event"
http_method => "post"
format => "json"
headers => ["Authorization", "Splunk YOUR_ENCODED_EVENTS_HEC_TOKEN"]
mapping => { "event" => "%{message}" "index" => "your_logs_index" "sourcetype" => "tenx_encoded" "fields" => { "tenx_sourcetype" => "%{tenx_sourcetype}" } }
}
}
}
Step 4: Verify End-to-End
Run these SPL queries to confirm everything is working:
1. Check templates are arriving:
Expected: JSON events withtemplateHash and template fields
2. Check KV store is populated:
Expected: Count > 0 (up to 5 minutes for the first templates)3. Check compact events expand:
Expected: Full expanded events, not~hash,var1,var2... format
4. On Kubernetes, check the metadata arrives as indexed fields:
Expected: one row per namespace, with no app involvedOn the OTel Collector, the field is k8s.namespace.name.
Templates indexed before the app
The "Consume KV" saved search stores new templates every 5 minutes. To load templates indexed before the app was installed, run this search once as an admin or power user:
Running it again is safe: templates already stored are kept, and their records are brought up to date where the installed app derives them differently.
Step 5: Search from the Search Bar
Write the tx macro in front of the search terms, after the index and any time terms:
The words after tx are ordinary SPL, applied to the expanded lines. NOT, OR, AND, phrases, parenthesised groups, wildcards, field conditions including IN (...), TERM(), CASE() and a trailing pipeline behave as they do on the original data. The same search works in Dashboard Studio panels, saved searches and alerts. Time modifiers go before tx: after it they would match no event, so the search stops with a message, as it does for a comma outside quotes. Where a deployment names its template index differently, edit the tenx-templates macro beside tenx-events.
Name compact indexes
Without tx, a keyword search over compact data finds only the events where the word is a value. Keep compact indexes out of users' default index sets and name them in searches.
Classic dashboards need no macro
Classic dashboards in an app carrying dashboard.js keep their panel SPL unchanged. See Expansion in Other Splunk Apps below.
Verification Checklist
Use this checklist to diagnose issues at each stage of the pipeline.
Templates Arriving in Splunk
Test Query:
| Result | Meaning | Action |
|---|---|---|
| Count > 0 | Templates arriving | Proceed to KV store check |
| Count = 0 | No templates received | Check forwarder config, HEC token, network connectivity |
Check raw event format:
Expected format:
KV Store Populated
Test Query:
| Result | Meaning | Action |
|---|---|---|
| Count > 0 | KV store populated | Proceed to expansion check |
| Count = 0 | Templates not processed | Check "Consume KV" saved search |
Verify saved search configuration:
- Go to Settings → Searches, reports, and alerts
- Find "Consume KV" in the Log10x App
- Verify search string includes:
index=tenx_dml sourcetype=tenx_dml_raw_json - To store templates now, run
index=tenx_dml sourcetype=tenx_dml_raw_json earliest=-30d | sendalert tenx_dml_to_kvas an admin or power user. The Run button runs the search without its alert action, so it stores nothing.
Events Expanding Correctly
Test Query:
| Result | Meaning | Action |
|---|---|---|
| Full expanded events | Expansion working | None |
~hash,var1,var2... format |
Events not expanding | Check hash exists in KV store |
{"log":"~hash,..."} |
JSON wrapping | Add event_key $log to forwarder |
Check if template hash exists:
Known Limits
The app stores each compact event whole up to 262,144 bytes (256 KB), the TRUNCATE value on the tenx_encoded sourcetype. Splunk cuts a longer event at index time and adds no marker to it; the cut drops the event's trailing values, so it expands to fewer lines than the original held. A single compact event passes that size when the Receiver groups many lines of one message into it, such as a very long multi-line stack trace. The longest event in the OpenTelemetry demo sample is 25,472 bytes.
_time on a compact event is the time in its original line, when the line has one dated from 2,000 days before indexing to 2 days after, and the time Splunk indexed it otherwise. An event with the indexed field tenx_time=sender keeps the time its sender gave it. The app sets it while events are parsed, so in a distributed deployment it goes on the indexers or heavy forwarders as well as the search heads.
Warning
With the Receiver on each host, before the heavy forwarder, the heavy forwarder's index-time rules do not apply to compact events: index overrides, masks (SEDCMD, _raw rewrites), nullQueue filters and index-time fields. A value such a mask hides on raw events is readable after expansion, and events such a filter drops are indexed and counted against the license. To keep these rules, place the Receiver after the heavy forwarder's parsing.
Words that live in a template need tx. A plain search such as index=app_logs error matches a compact event only when the word is one of its values; a word that is part of the template's constant text is in the KV Store, not the event. tx looks each word up in the templates and selects the compact events that carry it as a value or through their template, then applies the full search to the expanded lines. A word a rendered timestamp could print (one or two digits, a year, an epoch, month and day names), a word with a character outside a-z and 0-9 (Zürich), and a word carried by more than 5,000 templates select nothing on their own; a NOT, a field comparison, or an OR with any of these selects every event in range. Expanding every event in range costs about 40 seconds per 150,000 compact events on one laptop, against about 1.5 to 4 seconds for a search with a usable word. A number that appears only inside a timestamp (milliseconds, a date) is not found, since the compact event holds the timestamp as an epoch. The template lookup runs inside a subsearch, under Splunk's subsearch time limit of 60 seconds by default; a dictionary of tens of thousands of templates has not been measured. A second compact sourcetype is searched once it is added to the tenx-events macro in the indexed form sourcetype::name.
Time modifiers go before tx, and a comma after it goes in quotes. The words after tx are the arguments of a later search command, where earliest= and latest= match no event and a comma outside quotes is matched literally. tx stops such a search with a message instead of returning nothing.
tx inside another subsearch or macro. Inside append, join or a subsearch, or wrapped in another macro, tx cannot read its own words. It then expands every compact event in range and applies the words after, with a warning: the same result, more slowly.
Events and counts. A compact event is the event the Receiver formed. A line without a timestamp of its own, such as a line of a stack trace, joins the line before it from the same source, so a stack trace is one event and a count counts events. Words joined with AND can match on different lines of one event, and NOT excludes the whole event. On a forwarder path the Receiver joins lines in the order the forwarder delivers them; a forwarder that retries a chunk after later ones (at start before the Receiver listens, or after a timeout) can change where a multi-line event ends. Join multi-line events in the forwarder and set groupJoinLines false where event boundaries must not change.
Sources read by an add-on. A vendor add-on's search-time rules run on the raw event, before tx expands a compact one. The app's txf macro applies those rules after expansion. It is checked with the Windows, AWS and FortiGate add-ons; the steps are in Fields of the Original Sourcetype.
Data models, their accelerations and tstats read a source's fields without the tx macro. A field profile makes the Receiver attach those fields to each compact event as indexed fields, one profile per Receiver. With one line in the app's props.conf on the instances that parse them, each compact event is then indexed under its original sourcetype, as Compact Events Under the Original Sourcetype describes.
With the Windows and FortiGate add-ons, the CIM data models tested (Authentication, Change, Endpoint and Network_Traffic) give the same results for compact Windows Security events, in XML and in classic text, and FortiGate events as for the raw events. For Sysmon events, the Endpoint Processes model does.
Keep add-on sources without a profile (Palo Alto, Zeek, CrowdStrike, Okta and the like) out of the Receiver where data models, Enterprise Security or searches without tx read them.
Cisco sourcetypes stay raw as well: Splunk meters them at a reduced rate only under their own sourcetype, and compacted they would meter about 1.3 times their raw cost.
The templates index needs read access. tx resolves words against index=tenx_dml. A role that cannot read it still finds words that are values, and finds nothing for words that are template text, with no message. Give every role that searches compact data read access to the templates index, and keep the tenx-templates macro and dest_dml_index in tenx_config.conf pointing at the same index.
Replication lag. With replicate = true on the collection, the expansion runs on the indexers, which read the templates from the knowledge bundle. A new template reaches the indexers with the next bundle, about a minute; after a search head restart the first bundle takes one to two minutes, and a search run before it arrives returns no compact events and no message. The bundle carries the whole collection, about 3.5 KB per template.
Field conditions inside a grouped event. A field in a line that the Receiver grouped under a timestamped line of its own container is read from the first record of the group only. Field conditions on the lines inside a multi-line event (a stack trace, a dump) do not match them.
Splunk's HTTP Event Collector accepts an event for any index its token allows, and an indexer that has not loaded that index drops it unless lastChanceIndex is set, logging Received event for unconfigured/disabled/deleted index=<index>.
Fluent Bit's Splunk output has no indexer acknowledgement, so when the HTTP Event Collector answers 503, a chunk it sends again can be indexed twice. Fluent Bit's Splunk output does not retry a 404, so events it sends while the HTTP Event Collector is restarting are dropped.
When the Fluent Bit pod stops, the records it has handed to the sidecar and not yet received back are lost, because the sidecar does not acknowledge them; records still waiting on the node's disk are sent by the next pod.
Each record reaches the sidecar with its Kubernetes metadata, and the sidecar's input limit (forwarderInputBytesLimit, 2 MB a second by default) counts those bytes too; a node that writes faster than that for long builds its backlog on disk. Raise it, or set it to 0 for no byte limit, on nodes that write more.
Troubleshooting
Templates Not Populating KV Store
Symptom: | inputlookup tenx-dml-lookup returns 0 rows even though templates exist in tenx_dml index.
Common Causes:
| Cause | Solution |
|---|---|
| Templates indexed before the app was installed, or while "Consume KV" was down | Run index=tenx_dml sourcetype=tenx_dml_raw_json earliest=-30d | sendalert tenx_dml_to_kv once |
| Saved search disabled | Enable in Settings → Searches, reports, and alerts → "Consume KV" |
| Templates in another index | Point the templates HEC token at tenx_dml |
Events Show Raw Encoded Format
Symptom: Events display as ~#ABC123,value1,value2,value3 instead of expanded JSON/text.
Common Causes:
| Cause | Solution |
|---|---|
| Template hash not in KV store | Wait 5 minutes for "Consume KV", or run the backfill search above |
| Hash mismatch (different data) | Verify encoded events match templates in tenx_dml |
| Search ran without expansion | On a dashboard, ensure dashboard.js is in that app; in the search bar, write tx in front of the search terms |
A tx search stops with a message about time modifiers or a comma |
Move earliest= and latest= before tx; remove the comma or put the text in quotes |
Debug hash lookup:
Events Wrapped in JSON
Symptom: Events arrive as {"log":"~hash,var1,var2..."} instead of raw encoded format.
Cause: Missing event_key $log in Splunk output configuration.
Solution: Add event_key $log to your encoded events OUTPUT section:
[OUTPUT]
Name splunk
Match_Regex ^tenx\.(?!tenx-template|tenx-stdout).*
Host your-splunk-host.com
Port 8088
Splunk_Token YOUR_TOKEN
event_index your_index
event_key $log
TLS On
This tells Fluent Bit to send only the log field content, not wrap it in JSON.
Cause: The HEC event is the whole record instead of its log value.
Solution: Set event to the log value in the record_transformer before the http output:
<filter **>
@type record_transformer
enable_ruby true
renew_record true
<record>
event ${record["log"]}
index your_index
sourcetype tenx_encoded
</record>
</filter>
This sends only the log field content as the event, not the full JSON record.
HEC Connection Refused or Timeout
Symptom: Forwarder logs show connection errors to Splunk HEC.
Diagnostic Steps:
-
Test HEC endpoint:
Expected:{"text":"HEC is healthy","code":17} -
Test with token:
Expected:curl -k https://your-splunk:8088/services/collector \ -H "Authorization: Splunk YOUR_TOKEN" \ -d '{"event":"test"}'{"text":"Success","code":0}
| Error | Cause | Solution |
|---|---|---|
| Connection refused | HEC disabled | Enable in Settings → Data inputs → HTTP Event Collector → Global Settings |
| 401 Unauthorized | Invalid token | Verify token value, check token is enabled |
| 403 Forbidden | Token restrictions | Check token's allowed indexes and sourcetypes |
| SSL error | Forwarder does not trust the HEC certificate | Install Splunk's CA certificate on the forwarder host; turn verification off only on a test instance |
Expansion in Other Splunk Apps
dashboard.js loads on every classic dashboard in the app that carries it. The Log10x App ships it, so its own dashboards expand. To expand classic dashboards in another app, copy the file there:
cp $SPLUNK_HOME/etc/apps/tenx-for-splunk/appserver/static/dashboard.js \
$SPLUNK_HOME/etc/apps/YOUR_APP/appserver/static/
Restart Splunk to load it.
Search bar and Dashboard Studio
The search bar and Dashboard Studio use the tx macro, as in the Quickstart.
Programmatic Hook for Custom Views
For custom classic dashboards, include the hook in JavaScript:
Components
| Component | Description |
|---|---|
| Search Hook | JavaScript module routing classic dashboard searches to the REST endpoint |
| tx Macro | Written in front of a search to search compact events from the search bar, Dashboard Studio, saved searches and alerts |
| tenxprefilter Command | Run once per search by tx; reads the search and selects the compact events to expand |
| Search Handler | REST endpoint transforming SPL queries |
| KV Store | Template patterns for event expansion |
| Inflate Macro | SPL macro joining events with templates |
| Consume KV Search | Scheduled search storing new templates in the KV Store |
| Analytics Dashboard | Compression and template metrics |
| Diagnostics Dashboard | Troubleshooting and verification tools |
This app is open source. View on GitHub.