Splunk Search

differences in multi-valued field over time

andreas_roth
Engager

Hi all,

I'm getting events like this:

time=11111 file=aaaa
time=11111 file=bbbb
time=11111 file=cccc
time=11111 file=dddd

time=22222 file=aaaa
time=22222 file=bbbb
time=22222 file=cccc
time=22222 file=dddd
time=22222 file=eeee

time=33333 file=aaaa
time=33333 file=bbbb
time=33333 file=cccc
time=33333 file=dddd
time=33333 file=ffff

...

time=99999 file=aaaa
time=99999 file=bbbb

now i want to determine the changes of the field "file" over time. I was trying to create transactions and using diff ... but this leads nowhere... 😞

Thanks for your help in advance,

Andreas

0 Karma

stephane_cyrill
Builder

Hi Andreas.rth,
I thin what you can do is:
1- you first extract the field name file either with a regex or by IFX

2- you can do this when you have you field value:

...........|stats first(file) AS new_value|eval change=if(values(file)!=new_value, "yes","NO")|table new_value change

3-you can decide on which time range to run the search

0 Karma

stephane_cyrill
Builder

Do you know in advance all the values of the field file?

0 Karma

andreas_roth
Engager

nope... so there is a script, crawling a directory from time to time. I need to find out which files were created or deleted.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...