Splunk Search

Alternative without transaction- Is it possible?

btcs2
Engager

Is it possible to do this query with out using transaction 

index="prod" source="mysource" | transaction startswith="create happening for test" endswith=("create done  " OR "create not done " )|stats count
Labels (3)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You appear to be counting the "transactions" which begin with one string and end with one of two other strings. Depending on your data, can you just not count the occurrences of the first string? If necessary, make sure this count is not greater than the sum of the occurrences of the two other strings?

0 Karma

btcs2
Engager

There can be different combinations . I just need the events that have this particular combination.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
index="prod" source="mysource" 
| rex "(?<event>create happening for test|create done  |create not done )"
| streamstats count reset_on_change=t by event
| where count==1
| streamstats window=1 current=f values(event) as previous
| where previous=="create happening for test"
| stats count
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @btcs2,

the startswith and endswith without a correlation key is the only condition where there isn't any other solution than transaction command.

if you have a unique correlation key, you could try to use stats, but without it isn't possible

Ciao.

Giuseppe

0 Karma

fredclown
Builder

What are you trying to accomplish without transaction? Is there a reason you do not want to use transaction?

0 Karma

btcs2
Engager

it take so much time to load .

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @btcs2,

this is the main reason because I try to avoid to use transaction comman all the times I can, but, as I said, if you haven't a key to correlate you events, transaction command is the only solution.

If possible, try to limit the maxtime for correlate events, this is the only workaround (when possible) to limit response time.

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...

Industry Solutions for Supply Chain and OT, Amazon Use Cases, Plus More New Articles ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Enterprise Security Content Update (ESCU) | New Releases

In November, the Splunk Threat Research Team had one release of new security content via the Enterprise ...