473,473 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Analysing Log files

1 New Member
Please I'm new to python programming. However, I have been trying to implement some python scripts for a server-side to read and analyse log files for security-related events. I have an idea of how it should go: like reading the log files line by line and parsing the lines into strings and then looking for strings matching user-define regular expressions and report on the matches but I'm having problems implementing it with python. Could anyone please kindly assist me with lines of codes and explanation.

Thanks
Aug 28 '06 #1
1 2714
ghostdog74
511 Recognized Expert Contributor
Please I'm new to python programming. However, I have been trying to implement some python scripts for a server-side to read and analyse log files for security-related events. I have an idea of how it should go: like reading the log files line by line and parsing the lines into strings and then looking for strings matching user-define regular expressions and report on the matches but I'm having problems implementing it with python. Could anyone please kindly assist me with lines of codes and explanation.

Thanks
You will need to know how to use open()
eg open a file for reading

Expand|Select|Wrap|Line Numbers
  1. for lines in open("file"):
  2.     do_something(lines)
  3.  
For more information, read the docs
here
Aug 29 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
44
by: Xah Lee | last post by:
here's a large exercise that uses what we built before. suppose you have tens of thousands of files in various directories. Some of these files are identical, but you don't know which ones are...
18
by: JKop | last post by:
Here's what I know so far: You have a C++ project. You have source files in it. When you go to compile it, first thing the preprocessor sticks the header files into each source file. So now...
18
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or...
1
by: Roman Ziak | last post by:
I switched to Windows server and logs generated by my ISP are pathetic comparing to those from Apache. I would like to do logging via PHP and use the same log for visits and for PHP tracing. That...
3
by: pantagruel | last post by:
Hi, My work is putting in a large application that is basically split up between 30 or so Javascript files. I have some security concerns about this application. Basic security concerns is: ...
5
by: Davo1977 | last post by:
Analysing text files to obtain statistics on their content You are to write a Perl program that analyses text files to obtain statistics on their content. The program should operate as follows: ...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
1
by: =?iso-8859-1?Q?Daniel_Lidstr=F6m?= | last post by:
(I posted this to m.p.pocketpc.developer but got no answers) Hello! I have a problem when launching my application. It starts with firing an assertion. This assertion is inside mfc or atl it...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.