What script/language/command should i use?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers What script/language/command should i use?
# 1  
Old 09-16-2008
Data What script/language/command should i use?

This maybe the dumpiest question you've ever been asked..but i've been browsing, searching and understanding lots of information that i get from the internet..i'm confused that i might be in the wrong way in understanding it since i have to do a system that count and build up a statistics for a server and the clock is ticking make me feel kind of lost..
And still i was left with a big confusion with what script/language/command should i use if i want to show the statistics from log files..
i have log files and i learn commands to grep it but the thing is that i confused with what script can bind them up..i am better with php and prefer the script but do i have to use another script such as Perl or else to show the output?
Your help is worth a lot Smilie
# 2  
Old 09-16-2008
It would help if you can identify which tool you are using to collect the statistics - my guess would be sar, but there are a hundred tools out there for collecting various statistics...
# 3  
Old 09-16-2008
i was working on a Unix server..the log files has already in the terminal..
i'm not allowed to use any tools to collect the statistics..i'm only allowed to use command and script since the log files is already provided in /etc..

all i need to do is create the script/command/use language to grep the information from the log files and then show it as an output..but i'm confused what script should i use since i also have to use command such as grep to collect the information..=(
# 4  
Old 09-16-2008
For simple searches inside a text file:
grep "text I am looking for" <logfile>

if you have a long list of strings that you are looking for, you can create a file that has one pattern on each line

Example patternFile:
Code:
Connection failed
Connection refused
retry
not responding

/usr/xpg4/bin/grep -f patternFile <logfile>

This will find any instances of patternFile in logfile.

Alternatively, if you have a list of patterns that you do not want to report on, you can create a file that you will exclude

Example excludeFile:
Code:
kern.info] pseudo-device:
My unqualified host name
root-root

/usr/xpg4/bin/grep -Vf patternFile <logfile>

You can use them together to find everything that matches the first pattern, but does not match the second pattern file:

Code:
/usr/xpg4/bin/grep -f patternFile <logfile> | /usr/xpg4/bin/grep -vf exclude File

Take the time to learn what each line means before filtering it out. You can hide a problem for a long time with the wrong filters...
# 5  
Old 09-17-2008
It would help if you showed us a small example of the log file and then a small example of the output you would like.
# 6  
Old 09-17-2008
Thank you avronius..it would help me in collecting the information of the users by using grep command..i have made some research and found that i can use either Perl or Php command line in providing the output..but i'm not that sure..

prym_admin..my project apparently as same as webalizer (if u guys ever heard of it). It is a system to collect information of the downloader or visitors of website where it get the information from the log files,grep the prefered information and make it as an ouput (such as in graph or table of statistics)..

example of log file:
Sep 13 04:22:25 terminal newsyslog[693]: logfile turned over
10.10.100.10 - - [13/Sep/2008:04:23:34 +0800] "GET /~home/folder/folder/folder/folder/file.php HTTP/1.1" 404 278 "-" "-"

it has the ip address,time,date,downloaded file,type of browser used and so on..this is just one line of it..
i need to get all the information automatically save into a new file and then i have to show the output of the new file into a graph or table..
thanks a lot and sorry for my late reply..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Feedback wanted for upcoming script language

Hi I'm currently rewriting a project from install-required to a pure runtime form. The former had required the project name and the definition of the command as name, as they all become functions now, this could be shorter. As you might have figured, the project already exists in another... (3 Replies)
Discussion started by: sea
3 Replies

2. Shell Programming and Scripting

Covert simple bash script in perl language

Hello, Anyone please covert this in perl language ######################## if ps faux | grep -v grep | grep ProcessXYZ then echo "$SERVICE is running, , everything is fine" exit 0 else echo "$SERVICE is not running" exit 2 fi Additional... (1 Reply)
Discussion started by: fed.linuxgossip
1 Replies

3. Shell Programming and Scripting

Very simple script using bash language

Dear AIXians, I have a task for very simple script, but I can't write it correctly :confused: I have a file called (out.txt), if any line of this file starts with the word 'ORA', it must send email, if the file (out.txt) don't have this word, so it do nothing. Please tell me how. ... (4 Replies)
Discussion started by: Mohannad
4 Replies

4. Programming

How to pass the command line arguments to the shell script in c language?

hi, I am new in the shell script, and c programming with linux. I am looking to pass the arguments in c program that should be executed by the shell script. e.g. #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv) { int i; for (i=1;i<argc; i++) { ... (2 Replies)
Discussion started by: sharlin
2 Replies

5. Shell Programming and Scripting

Language of the script

Hi, Can you let me know in which language is the below scrip written. @echo "*** PREINSTALL STARTED ***" @echo "---> Verify existence of top level directories and creating them " -$(INS) -d -m 755 $(DEST_PLUGIN_EXPORT_DIR) -$(INS) -d -m 755 $(DEST_PLUGIN_DOCS_DIR) ... (3 Replies)
Discussion started by: @bhi
3 Replies

6. Shell Programming and Scripting

How can i run the shell script from ABAP programming language

I am in need to execute the Files transferring's shell script from ABAP programming language. it would be highly appreciated if you help me as quickly as possible. Thank you (28 Replies)
Discussion started by: Venkat1818
28 Replies

7. Web Development

Simple Script for Multiple Language Sitemaps

Someone asked me to post a very simple script for creating multiple language sitemaps from a vbseo generated sitemap for vbulletin. You will need to create the required directories, change the paths and website name as appropriate. This code could be easily wrapped in a simple while loop and... (0 Replies)
Discussion started by: Neo
0 Replies

8. UNIX for Dummies Questions & Answers

Script Language Parser for Learning

I'm new to the UNIX world and have to learn scripting for my job. Presented with multiple scripts to learn (and then have to maintain in the future) is there a utility or process to input a script in it's native form and output what each line would look like fully parsed (i.e.: all variable names... (3 Replies)
Discussion started by: kcampb9
3 Replies
Login or Register to Ask a Question