dhcp lease log events will capture the following fields only:
1. lease_time -> lease timestamp
2. leased_ip -> leased ip address
3. userid -> user
4. session -> either "START or STOP"
Desired Output Table:
I have the search command below for a start. But i cannot figure out how do a time range search for each capture time in the csv file.
| search [|inputcsv test.csv | fields leased_ip]
If i do "| fields leased_ip capture_time", obviously it cannot match anything because capture_time is not equal to the lease_time
I'm currently looking at "gentimes" but I'm not sure if it is the correct command to use for this case or considering on switching to "inputlookup".
Any suggestions are very much appreciated. Thank You!
You need map like this:
| inputcsv test.csv | map search="search index=dhcp_leaselog leased_ip=$leased_ip$ | where lease_timestamp<$capture_time$ | dedup | eval capture_time=$capture_time$ | eval leased_ip=$leased_ip$ | fields userid, leased_ip, lease_time, capture_time"
Did this work?