Below query, I have used and it is saving in output lookup format.
Lookupname - S1_installedtime
Query - index=sentinelone |table installedAt agentComputerName agentDomain |search installedAt!="Null" |dedup agentComputerName
installedAt - This field is giving the installation time
Now I want a query that compares with the lookup table(S1_installedtime) and gives a result if any new agentComputerName in the last 1-week.
Objective - Need a list of agentComputerName having SentinelOne installed in the last 7 days.
In addition to @yuanliu comments, I would add some observations on your existing SPL
index=sentinelone
|table installedAt agentComputerName agentDomain
|search installedAt!="Null"
|dedup agentComputerName
|search installedAt!="Null"
could be part of the original search statement 'index=...'
The requirement above could use some explanation. If you already have the field installedAt in index=sentinelone, why is lookup S1_installedtime necessary?
If I take the liberty to guess, you want to
Assuming the original installedAt is in epoc time, the task could be as simple as
index=someotherindex
| lookup S1_installedtime agentComputerName
| where now() < relative_time(installedAt, 7d)
If installedAt is a text timestamp, use strptime to convert, e.g.,
index=someotherindex
| lookup S1_installedtime agentComputerName
| where now() < relative_time(strptime(installedAt, "%Y-%m-%d %H:%M:%S%Z"), 7d)
There is also time-based lookup (Define a time-based lookup in Splunk Web) that can make use of string timestamp field directly. If you use time-based lookup, you only have to select events where lookup returns a result
index=someotherindex
| lookup S1_installedtime agentComputerName
| isnotnull(installedAt)