Created
December 2, 2019 18:25
-
-
Save trevor-vaughan/f86f50a5c720543d128285925d5a8f09 to your computer and use it in GitHub Desktop.
Tlog syslog file session discovery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby -rjson -rpp -e 'output={}; File.read("/var/log/tlog.log").lines.map{|x| l=x.split(/\s/); foo=JSON.load(l[3..-1].join(" ")); output[foo["rec"]] ||= {:user => foo["user"], :start_time => l[0]}; output[foo["rec"]][:end_time] = l[0]}; pp output' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment