Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2014
    Posts
    5

    Unanswered: SSH Log generated but having troubles to find users between a time

    Attached is the log file that I have generated through the following script:
    last | head -2 |sed '2q;d' |awk '{ print $1"\t"$2"\t"$3"\t\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t" $9"\t"$10"\t"$11}'>>/var/log/logadmin/logtest.txt


    But now I'm unable to run the following operations on it:
    1. Count number of distinct users logged in & display their name and IP
    2. Count number of users logged in at a particular time & display their name
    3. Count number of users logged in between a particular time by taking input of the time intervals.

    Can anyone help me out for above operations as I want to give inputof Time Intervals by myself and then count and display the users logged at that time. I'am having difficulties in doing so.
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2014
    Posts
    5

    Problems in analysing SSH LOG users & time

    Attached is the log file that I have generated through the following script:
    last | head -2 |sed '2q;d' |awk '{ print $1"\t"$2"\t"$3"\t\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t" $9"\t"$10"\t"$11}'>>/var/log/logadmin/logtest.txt


    But now I'm unable to run the following operations on it:
    1. Count number of distinct users logged in & display their name and IP
    2. Count number of users logged in at a particular time & display their name (How to take the input of time)
    3. Count number of users logged in between a particular time by taking input of the time intervals.

    As I want to give input of Time Intervals by myself and then count and display the users logged at that time. I'am having difficulties in doing so.
    Attached Files Attached Files

  3. #3
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1
    Is this homework?
    If so start by modifying the logtest.txt file so that the date is numeric YYYYMMDD and the time is numeric HHMM.

  4. #4
    Join Date
    Apr 2014
    Posts
    5

    No it isn't

    I was just trying to make my own open project to have a database, btw i understood and did it
    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •