Configure transaction types
Any series of events can be turned into a transaction type. Read more about use cases in "About transactions", in this manual.
You can create transaction types via transactiontypes.conf. See below for configuration details.
For more information on configuration files in general, see "About configuration files" in the Admin manual.
Configure transaction types in transactiontypes.conf
- Create a
transactiontypes.conf
file in$SPLUNK_HOME/etc/system/local/
, or your own custom app directory in$SPLUNK_HOME/etc/apps/
. - Define transactions by creating a stanza and listing specifications for each transaction within its stanza. Use the following attributes:
- Create any number of transaction types, each represented by a stanza name and any number of the following attribute/value pairs.
- Use the stanza name,
[<TRANSACTIONTYPE>]
, to search for the transaction in Splunk Web. - If you do not specify an entry for each of the following attributes, Splunk Enterprise uses the default value.
- Set the maximum time span for the transaction.
- Can be in seconds, minutes, hours or days, or set to -1 for unlimited.
- For example: 5s, 6m, 12h or 30d.
- Defaults to -1.
- Set the maximum pause between the events in a transaction.
- Can be in seconds, minutes, hours or days, or set to -1 for unlimited.
- For example: 5s, 6m, 12h or 30d.
- Defaults to -1.
- The maximum number of events in a transaction. This constraint is disabled if the value is a negative integer.
- Defaults to 1000.
- If set, each event must have the same field(s) to be considered part of the same transaction.
- For example:
fields = host,cookie
- For example:
- Defaults to " ".
- Relevant only if
fields
is not empty. Controls whether an event that is not inconsistent and not consistent with the fields of a transaction opens a new transaction (connected=true) or is added to the transaction. - An event can be not inconsistent and not consistent if it contains fields required by the transaction but none of these fields has been instantiated in the transaction (by a previous event addition).
- Defaults to:
connected = true
- A search or eval filtering expression which, if satisfied by an event, marks the beginning of a new transaction
- For example:
startswith="login"
startswith=(username=foobar)
startswith=eval(speed_field < max_speed_field)
startswith=eval(speed_field < max_speed_field/12)
- Defaults to: " ".
- A search or eval filtering expression which if satisfied by an event marks the end of a transaction
- For example:
endswith="logout"
endswith=(username=foobar)
endswith=eval(speed_field > max_speed_field)
endswith=eval(speed_field > max_speed_field/12)
- Defaults to: " "
<search-expression>
is a valid search expression that does not contain quotes.<quoted-search-expression>
is a valid search expression that contains quotes.<eval-expression>
is a valid eval expression that evaluates to a boolean. For example,startswith=eval(foo<bar*2)
will match events wherefoo
is less than 2 xbar
."<search-expression>"
:startswith="foo bar"
<quoted-search-expression>
:startswith=(name="foo bar")
<quoted-search-expression>
:startswith=("search literal")
eval(<eval-expression>)
:eval(distance/time < max_speed)
- Use the transaction command in Splunk Web to call your defined transaction (by its transaction type name). You can override configuration specifics during search.
[<transactiontype>] maxspan = [<integer> s|m|h|d|-1] maxpause = [<integer> s|m|h|d|-1] fields = <comma-separated list of fields> startswith = <transam-filter-string> endswith=<transam-filter-string>
[<TRANSACTIONTYPE>]
maxspan = [<integer> s|m|h|d|-1]
maxpause = [<integer> s|m|h|d|-1]
maxevents = <integer>
fields = <comma-separated list of fields>
connected= [true|false]
startswith = <transam-filter-string>
endswith=<transam-filter-string>
For both startswith
and endswith
, <transam-filter-string>
has the following syntax:
"<search-expression>" | (<quoted-search-expression> | eval(<eval-expression>)
Where:
Examples:
For more information about searching for transactions, see "Search for transactions" in this manual.
Additional transaction configuration attributes
transactions.conf
includes a few more sets of attributes that are designed to handle situations such as multivalue fields and memory constraint issues.
Transaction options for memory constraint issues
maxopentxn=<int>
- Specifies the maximum number of not yet closed transactions to keep in the open pool before starting to evict transactions, using LRU (least-recently-used memory cache algorithm) policy.
- The default value of this attribute is read from the transactions stanza in
limits.conf
.
maxopenevents=<int>
- Specifies the maximum number of events (which are) part of open transactions before transaction eviction starts happening, using LRU (least-recently-used memory cache algorithm) policy.
- The default value of this attribute is read from the transactions stanza in
limits.conf
.
keepevicted=[true|false]
- Whether to output evicted transactions. Evicted transactions can be distinguished from non-evicted transactions by checking the value of the
evicted
field, which is set to1
for evicted transactions. - Defaults to
keepevicted=false
.
Transaction options for rendering multivalue fields
mvlist=[true|false]|<field-list>
- The
mvlist
attribute controls whether the multivalue fields of the transaction are (1) a list of the original events ordered in arrival order or (2) a set of unique field values ordered lexigraphically. If a comma- or space-delimited list of fields is provided, only those fields are rendered as lists. - Defaults to:
mvlist=false
.
delim=<string>
- A string used to delimit the original event values in the transaction event fields.
- Defaults to:
delim=" "
nullstr=<string>
- The string value to use when rendering missing field values as part of multivalue fields in a transaction.
- This option applies only to fields that are rendered as lists.
- Defaults to:
nullstr=NULL
Search for transactions | About lookups |
This documentation applies to the following versions of Splunk® Enterprise: 7.0.0, 7.0.1, 7.0.2, 7.0.3, 7.0.4, 7.0.5, 7.0.6, 7.0.7, 7.0.8, 7.0.9, 7.0.10, 7.0.11, 7.0.13, 7.1.0, 7.1.1, 7.1.2, 7.1.3, 7.1.4, 7.1.5, 7.1.6, 7.1.7, 7.1.8, 7.1.9, 7.1.10, 7.2.0, 7.2.1, 7.2.2, 7.2.3, 7.2.4, 7.2.5, 7.2.6, 7.2.7, 7.2.8, 7.2.9, 7.2.10, 7.3.0, 7.3.1, 7.3.2, 7.3.3, 7.3.4, 7.3.5, 7.3.6, 7.3.7, 7.3.8, 7.3.9, 8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.5, 8.0.6, 8.0.7, 8.0.8, 8.0.9, 8.0.10, 8.1.0, 8.1.1, 8.1.3, 8.1.4, 8.1.5, 8.1.6, 8.1.7, 8.1.8, 8.1.9, 8.1.11, 8.1.13, 8.2.0, 8.2.1, 8.2.2, 8.2.3, 8.2.4, 8.2.5, 8.2.6, 8.2.7, 8.2.8, 8.2.9, 8.2.10, 8.2.11, 8.2.12, 9.0.0, 9.0.1, 9.0.2, 9.0.3, 9.0.4, 9.0.5, 9.0.6, 9.0.7, 9.0.8, 9.0.9, 9.0.10, 9.1.0, 9.1.1, 9.1.2, 9.1.3, 9.1.4, 9.1.5, 9.1.6, 9.1.7, 9.2.0, 9.2.1, 9.2.2, 9.2.3, 9.2.4, 9.3.0, 9.3.1, 9.3.2, 9.4.0, 8.1.10, 8.1.12, 8.1.14, 8.1.2
Feedback submitted, thanks!