Hi,
I basically need to lookup the field creationTime in an object log for objects that show up in a request log. Using join/subsearch this works fine, but due to the join command returning only 10000 values, I need another solution.
table: request_log (3000000+ entries)
_time, run_id, object_id
2016-05-21 10:13:34, 1238, 342_1
2016-05-21 10:13:37, 1239, 4432
2016-05-21 10:13:43, 1240, erweww
2016-05-21 10:13:44, 1241, sdf4_1
2016-05-21 10:13:44, 1242, 342_1
2016-05-21 10:13:51, 1243, erweww
each object_id can/will exist multiple times
table: object_log (400000+ entries)
_time, object_id
2012-01-17 21:48:21, 342_1
2012-10-30 14:28:25, erweww
2014-09-23 07:41:12, sdf4_1
2015-11-02 10:08:55, 4432
Each item has a single entry
As a result I need the age of an item once it shows up in the request table.
desired result table
_time, object_id, creationTime, ageDays
21/05/2016 10:13:51.000, erweww, 2012-10-30 14:28:25, 1299
21/05/2016 10:13:44.000, 342_1, 2012-01-17 21:48:21, 1585
21/05/2016 10:13:44.000, sdf4_1, 2014-09-23 07:41:12, 606
21/05/2016 10:13:43.000, erweww, 2012-10-30 14:28:25, 1299
21/05/2016 10:13:37.000, 4432, 2015-11-02 10:08:55, 201
21/05/2016 10:13:34.000, 342_1, 2012-01-17 21:48:21, 1585
This is the query I'm using to build the result table:
source="requests_log.txt" | join type=left object_id [search source="object_log.txt" | eval creationTime=field1] | eval ageDays=round(((strptime(dt,"%Y-%m-%d %H:%M:%S") - strptime(creationTime,"%Y-%m-%d %H:%M:%S"))/86400),0)
The query in general works fine, but due to the limitaions of the number of results (10000) the results are mssing data.
That means many rows don't contain creationDate and ageDays values.
Limitations about subsearches.
http://docs.splunk.com/Documentation/Splunk/6.4.1/Search/Aboutsubsearches
There are some similar problems in Splunk answers, but so far I've been unable to adjust them. Maybe someone can lead me the way.
... View more