Try something like this (to avoid joins) index=main source="/media/ssd1/ip_command_log/command_log.log"
| eval exec_time=strptime(exec_time, "%a %b %d %H:%M:%S %Y")
| rename ip_execut as Access_IP
|...
See more...
Try something like this (to avoid joins) index=main source="/media/ssd1/ip_command_log/command_log.log"
| eval exec_time=strptime(exec_time, "%a %b %d %H:%M:%S %Y")
| rename ip_execut as Access_IP
| table Access_IP, exec_time, executed_command
| append
[ search index=main source="/media/ssd1/splunk_wtmp_output.txt"
| dedup Access_time
| eval Access_time=strptime(Access_time, "%a %b %d %H:%M:%S %Y")
| eval Logoff_time=if(Logoff_time="still logged in", now(), strptime(Logoff_time, "%a %b %d %H:%M:%S %Y"))
| table Access_IP, Access_time, Logoff_time ]
| eval event_time=coalesce(Access_time, exec_time)
| sort 0 event_time
| streamstats global=f latest(Access_time) as Access_time latest(Logoff_time) as Logoff_time by Access_IP
| where exec_time>=Access_time AND exec_time<=coalesce(Logoff_time,now())
| table Access_IP, Access_time, Logoff_time, exec_time, executed_command