Skip to content

About

Splunk app (Splunkbase 9866) that expands 10x compact events back to their original lines at search time.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Log10x App

License

Search and visualize compact events in Splunk. This open-source Log10x app expands compact events back to their original lines at search time, while the ingested volume, and with it the license bill, stays reduced. It runs on Splunk Enterprise 9.4 through 10.6, and the package passes AppInspect's Splunk Cloud checks.

Blog: Search compact logs in Splunk using the 10x app. How Splunk stores fewer bytes and still returns the original log lines.

To find optimization opportunities in your existing Splunk data, point the Log10x MCP server at your Splunk backend with read-only credentials and ask it to run a cost POC. It pulls a representative sample via SPL, runs the 10x engine locally to rank message types, and returns a per-pattern cost and savings report with drop/compact/offload actions. Install with claude mcp add --transport stdio --env LOG10X_API_KEY=your-api-key log10x -- npx -y log10x-mcp.

How It Works

A compact event carries a template hash and its variable values. The Receiver sends each template once, the app keeps it in its template store, and searches put the constant words back. 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 tx macro in front of the search terms, after the index and any metadata or time terms: index=app_logs `tx` error "payment failed". The words after it are ordinary SPL, applied to the expanded lines. Classic dashboards keep their panel SPL unchanged: dashboard.js routes each panel's search through the app's REST endpoint. An alert created on the app's Alerts page compiles once into a native saved search.

Ingestion Flow

The Receiver running in Compact mode compacts events at the edge, and Splunk ingests them at reduced size:

Receiver  -->  Ingest (HEC)  -->  Template store
                             -->  Index (compact events, metadata as indexed fields)

Search Flow

Each path selects the compact events that can match, then expands them and applies the search to the original lines:

Search bar, Dashboard Studio, saved search:  `tx` macro  -->  prefilter (tenxprefilter)  --\
                                                                                           +-->  Expand  -->  Full results
Classic dashboard panel:  dashboard.js hook  -->  /tenx-search rewrite  -------------------/

On one laptop running Splunk 10.4.3, a tx search over 157,228 compact events returned in about 1.5 to 4 seconds, where the same search over the raw lines took under a second; the | tx command, which writes every event out itself, took two to five times as long as the macro.

Scheduled alerts run server-side, where the browser hook never fires. An alert created on the Alerts page, or through the /tenx-alert endpoint, is compiled once at save time into native SPL, a template hash prefilter plus the tenx-inflate macro, so the scheduler runs an ordinary saved search. This is handled by the /tenx-alert REST endpoint and the Alerts page (with a recompile pass that converts | tx and | tenxsearch alerts and refreshes prefilters as templates appear). See SAVE_TIME_ALERTS.md.

Receiver-side configuration

Start the Receiver with five arguments for any deployment that feeds this app. receiverOptimize true makes it send events compact, and groupJoinLines false keeps each forwarder record one Splunk event. The other three are options of the Receiver's configuration; from engine 1.1.89 they can also follow the app on the command line, which replaces the values the app's configuration sets. With the published image, beside a Fluent Bit container:

docker run -d --name tenx-receiver --network container:<Fluent Bit container> log10x/edge-10x:1.1.183 \
  @run/input/forwarder/fluentbit @apps/receiver receiverOptimize true varMaxRecurIndexes 0 \
  timestampZone UTC timestampMaxPerObject 1 groupJoinLines false

The first argument names the input module for the forwarder in use, here Fluent Bit; the forwarder inputs page lists the others.

The Receiver runs in Fluent Bit's network, so restart the Receiver after each restart of Fluent Bit. With Retry_Limit False, Fluent Bit keeps the records it reads in the meantime and sends them when the Receiver is back. Fluent Bit's side, two processes with their buffers on disk, is in the app's README: Fluent Bit Beside the Receiver.

The three options live in two files of the Receiver's config folder ($TENX_CONFIG, mounted at /etc/tenx/config in the container image):

# pipelines/run/template/config.yaml
var:
  maxRecurIndexes: 0

# pipelines/run/transform/timestamp/config.yaml
timestamp:
  maxPerObject: 1
  zone: UTC

With the shipped configuration, these arguments start the Receiver with these values. Setting them in these files instead works as well.

Back-references

Set varMaxRecurIndexes: 0. The app expands templates whose values all travel in the event. The Receiver's varMaxRecurIndexes setting lets a template refer back to an earlier value ($N) instead. The setting applies to the whole Receiver process. At 0, modeled reduction is about half a percentage point lower on a Kubernetes/OTel dataset, and every event expands exactly.

A Receiver that also feeds Elasticsearch applies the setting there too. The elasticsearch-plugin decodes either form, and that traffic compresses about half a point less.

Timestamps

Set timestampZone: UTC.

A timestamp that carries no zone marker of its own, 2025-10-02 06:35:34,498, is only a time once something decides which zone it was written in. The Receiver decides, and by default it uses the clock of the host it runs on. That choice is not recorded in the compact event, so this app cannot recover it: the same line compacted on a host in New York and on a host in UTC produces two different events, and nothing downstream can tell them apart.

Pinning the Receiver to UTC makes that choice fixed and knowable, and this app's tenx-inflate macro renders in UTC to match. Without it, expansion returns a time shifted by the difference between the Receiver's host clock and UTC.

A timestamp written in UTC, ending in Z, +0000 or +00:00, is unaffected.

One timestamp per event

Set maxPerObject: 1 in the Receiver's timestamp configuration (timestamp.maxPerObject).

The Receiver records every timestamp it finds in an event as its own slot. This app stores one timestamp format per template, so a template with two slots cannot render both. At 1 the first timestamp keeps its slot and any later one becomes an ordinary variable whose text round-trips unchanged.

Store-time checks

Back-references, multi-timestamp templates and two different templates under one template hash are detected when stored. Their events stay compact and carry tenx_expand_refused naming the reason, back-reference, multiple-timestamps or hash-conflict, so every expanded line is the original line. The Health page lists every refused template. To clear a hash-conflict after deciding which template is right, delete that key from the tenx_dml collection and run the backfill search in Step 5. A Receiver's clock zone leaves no trace in the data, so timestampZone: UTC is required rather than checked.

An event whose template is found but whose expansion gives no text also stays compact, with tenx_expand_refused set to empty-expansion; an event whose template is not found, with no-template. An empty line has an empty template, and tx returns its event with empty text.

Event time on compact events

A compact event's _time is the time in its original log line wherever the Receiver wrote one, and the time Splunk indexed it otherwise. The Receiver writes a template's timestamp as an epoch in the event's first variable, 13 digits for milliseconds or 19 for nanoseconds. The tenx-event-time transform sets _time from the event's first variable of that shape while the event is parsed, when that time falls between 2,000 days before indexing and 2 days after. The window is fixed in the transform; MAX_DAYS_AGO and MAX_DAYS_HENCE do not change it. An event outside it, such as a replay of logs more than 2,000 days old, takes the time Splunk indexed it. Searches and alerts over a time range select late and replayed logs by the time in the line.

Measured on Splunk 9.4.15, 10.4.3 and 10.6.0.5, the same on each, with the OpenTelemetry demo sample, 157,228 compact events: of the 134,668 whose original line carries a timestamp Splunk recognizes, 134,340 get that time as _time to the second and 133,658 to the millisecond. The other 328 are lines without a full date, which the Receiver and Splunk complete differently (glog lines carry no year, and three lines carry only a time of day), and three lines where Splunk reads a number as a time. Where a template's timestamp stops at whole seconds, _time does too.

The transform adds no licence-metered bytes: in the E21 licence run on Splunk 10.4.3 the compact events metered exactly their raw text, 74,338,244 bytes, with it on. It is a parsing setting, so it runs where compact events are parsed (see Step 1).

Timestamps in expanded lines

Every timestamp renders in UTC for every viewer, at every hour of the year. Checked on Splunk 9.4.15, 10.4.3 and 10.6.0.5 with 10,708 events at 2,677 instants, among them every ten minutes for 14 hours either side of the 2026 daylight-saving transitions, expanded by viewers in eight zones (UTC, America/New_York, Europe/London, Australia/Sydney, Pacific/Chatham, America/Adak, Asia/Kolkata, Etc/GMT-4): every line is the UTC text. A zone in the timestamp format prints +0000 or UTC.

Quickstart

Prerequisites

Requirement Description
Splunk Enterprise 9.4 through 10.6
Admin Access Required for app installation and KV Store setup

Step 1: Install Splunk App

Download the package from Splunkbase, install it with Splunk's app install, and restart:

$SPLUNK_HOME/bin/splunk install app tenx-for-splunk-<version>.tar.gz
$SPLUNK_HOME/bin/splunk restart

In a shell without a Splunk login, add -auth <user>:<password> to the install.

In a distributed deployment, install the app on the search heads and on the indexers or heavy forwarders that parse compact events. The compact sourcetype's parsing settings, TRUNCATE and the event time, apply on the instance that parses the data. What to Install on Each Tier lists every tier.

Step 2: Create the Index and HEC Tokens

Create an index named tenx_dml for templates, then two HTTP Event Collector tokens: one for templates, one for compact events.

Templates Token:

Setting Value
Name tenx-templates
Source type tenx_dml_raw_json
Index tenx_dml

Compact Events Token:

Setting Value
Name tenx-encoded
Source type tenx_encoded
Index Your target index

Step 3: Configure the Receiver and Forwarder

Start the Receiver with receiverOptimize true, varMaxRecurIndexes 0, timestampZone UTC, timestampMaxPerObject 1 and groupJoinLines false (see Receiver-side configuration), and point your forwarder at both tokens: templates to tenx_dml, and each compact event as the message with the record's metadata as indexed fields. The setup guide has the Fluent Bit and Fluentd configuration.

Step 4: Point the Dashboards at Your Index

Set the tenx-events macro to your compact index under Settings > Advanced search > Search macros, for example index=my_compact_index sourcetype::tenx_encoded. Every tx search starts with this macro too, so it uses the indexed form sourcetype::.

Where an index also holds raw events of the same sources, such as those indexed before the Receiver, name them in the tenx-raw-events macro so that tx and txf return them too: see Raw Events from Before the Receiver.

Step 5: Load Existing Templates

The Consume KV saved search stores new templates every five minutes, and its first run after an install or an upgrade reads every template record in the index. To load them again after the KV collection was emptied or restored, run this once as an admin or power user:

| makeresults | sendalert tenx_dml_to_kv param.from=0

The app's Backfill KV saved search holds the same search; the Run button does not fire its alert action, so run the search above. See Loading Templates Indexed Earlier.

Step 6: Verify End-to-End

Run these SPL queries to confirm everything is working:

Check templates are arriving:

index=tenx_dml sourcetype=tenx_dml_raw_json | head 10

Check that templates are stored:

| inputlookup tenx-dml-lookup | stats count

Check compact events expand:

index=your_logs_index `tx` | head 10

Security Sources

The txf macro gives expanded events the fields, event types and tags of their original sourcetype. Setup: Fields of the Original Sourcetype, What to Install on Each Tier. Before a source moves, the search report lists which of a search head's saved searches, alerts and dashboard panels need an edit.

Pages

Page What it shows
Overview Compact events for the chosen time range, the event text volume they save and the reduction, per index and source type; a row opens a tx search of that source. Sizes are estimated from a sample of the events; event counts are exact.
Health Six checks, from compact events arriving to every event expanding, including that a search returns the same event as was indexed, and the template store's last load. When there are any, the page lists templates the app refuses to expand and source types whose index-time masking does not apply to compact events.
Search Splunk's search page; write tx or txf in front of the search terms.
Alerts Compile a search into a scheduled alert that runs as native SPL.

Components

Component Description
Search Hook dashboard.js, routing each classic dashboard panel's search to the Search Handler
Search Handler /tenx-search REST endpoint rewriting a search for compact events
tx Macro Written in front of a search to search compact events by what the lines say, from the search bar, Dashboard Studio, saved searches and alerts
txf Macro tx with the search-time fields of the original sourcetype; see Fields of the Original Sourcetype
tenxreplay Command Writes the replay macros txf runs, from the search head's props; run by the Rebuild Field Replay saved searches
Search Report bin/tenx_search_report.py: says which saved searches, alerts and dashboard panels run unchanged or need tx or txf when a source moves to compact events; see Which Searches Change
tenxprefilter Command Run once per search by the tx macro; reads the search, looks up the templates that carry its words, and selects the compact events to expand
tx and tenxsearch Commands | tx <search> and | tenxsearch searchstring="...": generating commands that write every event out through Python, kept so saved searches written with them keep working
tenxrecompile Command Recompiles every compiled alert so it picks up new templates
Alert Compiler /tenx-alert REST endpoint compiling a search into a native scheduled alert at save time (with a recompile/migrate pass)
Alerts Page Compiles, reviews and recompiles save-time alerts
Template Store The templates searches use to expand events, in the tenx_dml KV store collection
tenx-inflate Macro Expands each compact event with its template
Consume KV Search Scheduled search storing new templates in the template store
Backfill KV Search The same template load from the start of the index, after the template store was emptied or restored
Recompile Compiled Alerts Search Runs tenxrecompile every 15 minutes
Rebuild Field Replay Searches Run tenxreplay every hour, and every five minutes for sourcetypes not yet covered
Overview Page Compact events, volume saved and reduction per source
Health Page Checks that events arrive, templates are stored and events expand

Documentation

For complete documentation including troubleshooting, advanced configuration, and integration guides, see:

License

This repository is licensed under the MIT License.

Log10x Receiver license

This repository contains a Splunk app for expanding Log10x compact events. The app is open source. The Log10x Receiver that produces compact events runs on the built-in Free tier with no license token on up to 10 nodes, with no expiry; above 10 nodes it takes a paid license.

Component License
This repository (Splunk app) MIT (open source)
Log10x Receiver Free tier on up to 10 nodes; paid license above 10

What this means:

  • You can freely use, modify, and distribute this Splunk app
  • The Log10x Receiver runs with no license token on up to 10 nodes
  • Above 10 nodes, the Receiver takes a paid license

Get Started:

Contributing

Contributions are welcome as pull requests to this repository.

Support

For issues and feature requests:

About

Splunk app (Splunkbase 9866) that expands 10x compact events back to their original lines at search time.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages