Trouble with log file..


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Trouble with log file..
# 1  
Old 02-20-2012
Trouble with log file..

Hi guys,
I have to filter out certain patterns from a log file (arerror.log, for those who know BMC Remedy). The problem is that the file is big, too big to be read properly. Filters aren't working properly on the file, and neither the entire contents are visible using more, or vi.
I FTP'd it to windows, and I was able to see 32768 pages of the log file, which constituted only one year of log.

Another funny thing is that, on unix I can see the logs of 2006(only), however on windows it's only for 2010. However I am sure that it contains logs from 2011 and 2012 as well.

The problem that I face is that any script I write won't work on the file as well. Any help on how to proceed would be highly appreciated.

Using:
Solaris 8
BMC Remedy 6.3 (JFYI)

Thanks a lot.
# 2  
Old 02-20-2012
what pattern you need to filter out ?

did u try grep and nawk or perl to process the file ?
# 3  
Old 02-20-2012
I tried grep, but it only processes the data that can be seen using the more pager, i.e. for the year 2006. If I grep it with "2010" or "2011", it doesn't show any records.

I didn't try perl or awk though.
# 4  
Old 02-20-2012
what is mean by "only processes the data that can be seen using the more pager" ?

post the sample data and what command you tried ?
This User Gave Thanks to itkamaraj For This Post:
# 5  
Old 02-20-2012
I mean the data that I can see by,
Code:
cat arerror.log | more"

It seems that only that much is being filtered by grep.

Sample data:
Quote:
Originally Posted by arerror.log
Fri Jan 15 09:32:16 2010 390603 : Failure during SQL operation to the database : ORA-24333: zero iteration count (ARERR 552)
This was taken from the file I FTP'd to windows. As you can see the year specified is 2010.
If I grep "2010" arerror.log in unix, no result is fetched.

Thanks for replying.
# 6  
Old 02-20-2012
can you try this.

Code:
 
nawk '/ 2010 /' arerror.log

# 7  
Old 02-20-2012
Lets get some base facts:

Code:
#1How big is the file?
ls -lad arerror.log

#How many records in the file?
wc -l arerror.log

#Contents of first record:
head -1 arerror.log

#Contents of last record:
tail -1 arerror.log

Is your limit of 32768 lines in Windows because you are using Microsoft Excel?
What version of Windows?


Was the file open by Remedy on the unix system when you tried to read the file with "grep"?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Trouble with archiving; only works if file exists already

Hi Folks - I have a script I am executing that I wish to archive the output(logfile) file once the script is done executing to a folder based on the following date format: YYYYMM For this example purpose, I am performing a simple MKDIR. The script works fine, but the archiving is the... (7 Replies)
Discussion started by: SIMMS7400
7 Replies

2. Homework & Coursework Questions

Trouble with Shell Script Compressing file

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: You will create a shell script that performs the following action: Use a parameter to pass a file that... (5 Replies)
Discussion started by: Luvs2drnk
5 Replies

3. Shell Programming and Scripting

Trouble reading content of file from a variable

Hi , i have a parameter which has path of a file. Now i need to have another parameter with the content of that file. I tried the belwo script , can any one please help. I dont want to use cat command to read. Can we do it with out using cat command. while read line do... (9 Replies)
Discussion started by: Ravindra Swan
9 Replies

4. OS X (Apple)

CUPS file modified causing trouble

I have modified the CUPS file - (deleted the Pause Printer part ) and now I cannot access anything under localhost:631, or printer settings through System preferences. They just keep freezing and there is no way I can get back to edit the config file. Any suggestions? thank you... (2 Replies)
Discussion started by: Ladybird
2 Replies

5. Shell Programming and Scripting

Trouble with catting a file

I have a perl script I am trying to modify and I cannot seem to get it to do right. I want it if the -l is ran with the script to cat the given file and then exit. my ( $help, $version, $list ); my $query = 0; my $default = ''; GetOptions( 'd|default=s' => \$default, 'q|query=s'... (3 Replies)
Discussion started by: bigbenn
3 Replies

6. Shell Programming and Scripting

Trouble with sed and ini file parsing

hi people, i'm having a hard time trying to extract a list of vars delimited by section inside a ini file ... let's consider this ini file : ; config file DESC = "channel synchro TGG01" DMM_VER = DMM23 PATH_FIFO = /users/tgg00/fifo QRT = BTS01.TGG.01.2 MODE_TRACE... (5 Replies)
Discussion started by: odium74
5 Replies

7. Shell Programming and Scripting

Trouble printing multiple lines to a new file

Hi, I'm trying to auto generate some php files with a default preamble at the top which is a block comment. The problem is that my output has no new lines and it looks like the output from "ls" is being printed after everyline This is my code #!/bin/bash read -d '' pre_amble... (1 Reply)
Discussion started by: racshot65
1 Replies

8. Shell Programming and Scripting

Trouble reading [noeol] file

cat can't show the last line of a file sftp transffered from Windows, because the last line is not ended with new line. Vi can show all line with warning I can append blank line in order for cat to show all lines, But is there a command to do this without modifying the file? > cat -A... (3 Replies)
Discussion started by: honglus
3 Replies

9. Shell Programming and Scripting

Trouble with a file path as awk output in for loop

When I run the following command in the shell it works fine. It prints a city name and then a path for a file. ~$ for i in `awk -F':' '{print $0}' /home/knoppix/Desktop/data/subs | grep -m 1 $ city | sed "s/:/ /"` >do >echo $i >done Now, when I place it in this shell script (sh) it prints... (6 Replies)
Discussion started by: afroCluster
6 Replies

10. Shell Programming and Scripting

trouble with moving a file

Hi , I'm not so new to linux but very very rusty. Trying to migrate my solar / wind power web server from Windows XP runnning apache to linux. I have the first part of the ftp down as you can see below. I'm having a problem once I have identified the daily file. I'm not being very clear with my... (3 Replies)
Discussion started by: Mikey
3 Replies
Login or Register to Ask a Question