07-17-2008
ok there is a problem, there is no check based on time.
I would need to check to see who was logged into the pts/# based on what time it was logged.
I know I can do it in perl, but would rather not.
if I have:
Jul 14 08:02:48 server1 su: - 0 user1-root
Jul 14 09:13:23 server1 su: + 0 user1-root
Jul 14 12:03:03 server1 su: + 0 user1-root
Jul 14 18:15:13 server1 su: + 0 user2-root
Jul 14 15:03:01 server1 su: + 0 user7-root
and
user1 pts/0 10.0.0.1 Thu Jul 14 08:00 - 10:00 (02:00)
user1 pts/0 10.0.0.2 Thu Jul 14 11:00 - 13:00 (02:00)
user2 pts/0 10.0.0.3 Wed Jul 14 16:00 - 20:00 (04:00)
user7 pts/0 hostx Wed Jul 14 13:25 - 15:01 (02:35)
I get:
Jul 14 08:02:48 server1 su: - 0 user1-root hostx
Jul 14 09:13:23 server1 su: + 0 user1-root hostx
Jul 14 12:03:03 server1 su: + 0 user1-root hostx
Jul 14 18:15:13 server1 su: + 0 user2-root hostx
Jul 14 15:03:01 server1 su: + 0 user7-root hostx
Last edited by Ikon; 07-17-2008 at 03:56 PM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have the following problem:
Input:
"num1","num2","num3",num4,num5,"num6"
required output:
"num1num2","num3",num4,num5,"num6"
I need to join field 1 and field 2 together but I always end up getting:
"num1""num2","num3",num4,num5,"num6"
Note that not all fields have " at both... (8 Replies)
Discussion started by: ReV
8 Replies
2. Shell Programming and Scripting
Hello
Please help me to write Shell script.
I want to merge 2 data files . The data files have common columns
The data file A have 3 columns
Host Version Numberof Failuers
The data file B have also 3 coulmns
Host Version NumberofFailuers .
I want to merge A and B file... (2 Replies)
Discussion started by: getdpg
2 Replies
3. Shell Programming and Scripting
I'm trying to merge multiple CSV (comma separated value) files into one large master file. All files have a field that is unique to act as the key for entry/merging into the master file & and all files have the same number of fields that are in the master file.
I'll give an example here:
... (2 Replies)
Discussion started by: jjinca
2 Replies
4. Shell Programming and Scripting
Hi,
I have 2 files that I got as an output from another program. They are :
File 1
((((((CtBJa:197.0,CtBTz:197.0):85.0,CtAHr:197.0):116.0,CtDUw:197.0):176.0,CtSwe:197.0):110.0,
(CtL2b:197.0,Ct4Bu:197.0):196.0):197.0,CmuNg:197.0);... (5 Replies)
Discussion started by: Lucky Ali
5 Replies
5. Shell Programming and Scripting
Hi all,
Sorry if someone has answered something like this already, but I have a problem. I am not brilliant with "awk" but think it should be the command to use to get what I am after.
I have 2 files:
job-file (several hundred lines like):
1018003,LONG MU WAN,1113S
1018004,LONG MU... (4 Replies)
Discussion started by: sgb2301
4 Replies
6. Shell Programming and Scripting
Hello,
I have a master database of a dictionary with the following structure:
a=b (b is a Unicode string)
a is the English part and b is the equivalent in a foreign language
I have also another file which has a database where the /b/ part of the string has been corrected by an expert. let us... (5 Replies)
Discussion started by: gimley
5 Replies
7. UNIX for Dummies Questions & Answers
Hello,
Firstly I just wanted to say that I'm not a programmer at all and appreciate any help you can give. I am trying to create a shellscript that reformats the file and adding up colums 5 and 6 for those sections that are continuation of the previous line(s) (signified by beginning with '*')... (4 Replies)
Discussion started by: neilh1703
4 Replies
8. Shell Programming and Scripting
Hi,
My input is
<message>
looking for a big
<message>Does fit my G74 laptop. Makes the 10 pound.
<message>
<message>This bag is the only one I could find to fit my awesome ASUS G74S.
<message>
<message>
Great bag my only wish is that they had put a pocket in which to store and... (6 Replies)
Discussion started by: pamu
6 Replies
9. Shell Programming and Scripting
Dear Unix experts and users
I have 2 kinds of files like below, of which I need to merge them in the order of time.
File1:
Date_Time Context D1 D2
04/19/2013_23:48:54.819 ABCD x x
04/19/2013_23:48:55.307 ABCD x x
04/19/2013_23:48:55.823 ABCD x ... (7 Replies)
Discussion started by: ks_reddy
7 Replies
10. Shell Programming and Scripting
Hi Everyone,
I have two files file1 and file2 with these contents
cat file1
AAAAA 01/03/2014 04:01:23
BBBB 01/03/2014 03:03:34
CCCcc 01/03/2014 03:03:34
cat file2
1 RED
1 HHHH
1 TTTT
1 BBBBB
I tried the below... (2 Replies)
Discussion started by: Aditya_001
2 Replies
LEARN ABOUT DEBIAN
fiaif-scan
FIAIF-SCAN(8) Administration and Privileged Commands FIAIF-SCAN(8)
NAME
fiaif-scan - print syslog entries in human readable form
SYNOPSIS
fiaif-scan [ -n ] [ -m ]
DESCRIPTION
fiaif-scan reads lines from STDIN and prints to STDOUT, in human readable form, any packets found (standard syslog format is assumed).
Each log message is parsed based on the configuration files at the time fiaf-scan is run. The idea is to enable the user to quickly iden-
tify which zone rule is causing the packet to be logged, and how to change this, if necessary.
OPTIONS
-n Don't do a reverse lookup of IP addresses or ports; display them as numbers. This reduces the number of host lookups and speeds up
scanning.
-m print the MAC address on each line.
EXAMPLE
fiaf-scan -n </var/log/messages
Scan from the current system log and display any packets on the console. Don't look up names for IP addressses or ports; just show
the numbers.
FILES
/etc/fiaif/fiaif.conf
AUTHOR
Anders Fugmann <anders(at)fugmann.net>
BUGS
The program has been tested only with messages from the standard syslog. It may work on lines from ulogd, but this has not been tested.
Bash may not be the fastest parser in the world. Expect this software to be slow. (40 lines per sec on a K6-II/300Mhz without name
lookups).
Please report other bugs to <fiaif@fiaif.net>.
SEE ALSO
fiaif.conf(5), zone.conf(5), iptables(8), syslog(3)
Linux Feb 2003 FIAIF-SCAN(8)