What is the purpose of the syslog log file?

  

Please add and complete the assignment. I received a 60/100 for this submission. I took a photo in class of what the solution should be.*Below is the comment from the professor.All of the log descriptionsandsample lines were OK, but you only attempted to provide regular expressions for 3 of those and no scripts were provided for any of those. The regular expressions were all incorrect and not creditable.
ITEC 325
Spring 2013
Assignment 3
Working individually you will choose five log files.
For each of the logs you should perform the following tasks:
Describe the log
Create a script that may be useful in managing the log
Illustrate why the script would be useful
Create one regular expression that may be useful in analyzing the log
Describe the rules that dictate the pattern of the regular expression
Illustrate why the regular expression would be useful.
(The regular expression should be part of the script)
When describing the log please provide 4 – 5 sample lines and discuss them briefly.
The five logs should be divided as follows:
Three logs generated by the system (for example: daemon, kern, syslog)
Two logs generated by installed applications (for example: mysql, apache
BASH SCRIPT ASIGNMENT
Identify 5 Log Files
1. sysLog.log
Contains information logged by the various background daemons that runs on the
system. Syslog file displays the running system information to help users detect errors
and troubleshoot. They provide a mechanism for a user to trace and identify any flows
within a given system. They also enable one to monitor events, activities or actions
leading to a certain flow.
Sample Log entries up to 4 Lines
The entries below show the types of processors supported by the kernel system as
logged on a specific date
Jun 28 19:16:07 ubuntu kernel: [
0.000000] KERNEL supported cpus:
Jun 28 19:16:07 ubuntu kernel: [
0.000000] Intel GenuineIntel
Jun 28 19:16:07 ubuntu kernel: [
0.000000] AMD AuthenticAMD
Jun 28 19:16:07 ubuntu kernel: [
0.000000] Centaur CentaurHauls
A regex expression that can be useful in managing the Log
The Regex expression below returns the Loge entries for a given date. It lops through
all the entries comparing the date with the one requested by a user.
[[ $line =~ .$string.* ]]
This can be useful in case an administrator wants to trace activities from a given date.
2. dpkg Log
This log file contains entries that are logged when a package is installed or removed
using dpkg command. It records all the apt activities, such as installs or upgrades, for
the various package managers also you can view synaptic logs through its Graphical
user interface.
Sample lines from the Log
2014-04-17 01:21:23 status unpacked base-files:amd64 7.2ubuntu5
2014-04-17 01:21:23 status half-configured base-files:amd64 7.2ubuntu5
2014-04-17 01:21:24 status installed base-files:amd64 7.2ubuntu5
2014-04-17 01:21:24 startup archives install
A regex ecpression to manage the log:
Illegal installations or unexpected upgrades tend to create unexpected problems. When
softwares update, users tend to realize some abnormalities. Troubleshooting to find
out when an upgrade was done can help identifies causes of malfunctions.
The regex code line below identifies when upgrades were made by displaying all lines
with the word upgrade.
[[ $line =~ .*$string.* ]]
It takes two arguments; a line from a file and a string specifying an upgrade.
3. kernel.log
The file provides a detailed log of messages from the Linux kernel. It helps in
troubleshooting the built in kernel especially newer custom versions.
Sample Code
Jun 28 19:16:07 ubuntu kernel: [
0.000000] BIOS-e820: [mem
0x00000000000e0000-0x00000000000fffff] reserved
Jun 28 19:16:07 ubuntu kernel: [
0.000000] BIOS-e820: [mem
0x0000000000100000-0x00000000a56affff] usable
Jun 28 19:16:07 ubuntu kernel: [
0.000000] BIOS-e820: [mem
0x00000000a56b0000-0x00000000a5eaffff] reserved
Jun 28 19:16:07 ubuntu kernel: [
0.000000] BIOS-e820: [mem
0x00000000a5eb0000-0x00000000aaabefff] usable
Kernel Log file gives detailed messages from the linux kernel.
4. Auth.Log:
This file keeps record of events and actions during authentication of users within a
Linux system. All authentication related activities, sessions user management
activities are logged on to this file. It also helps identify unauthorized access
attempts and successful access attempts to a system.
Sample Lines
Jun 28 19:16:17 ubuntu sudo: pam_unix(sudo:session): session opened for user
ubuntu by (uid=0)
Jun 28 19:16:17 ubuntu sudo: pam_unix(sudo:session): session closed for user
Ubuntu
Jun 28 19:16:17 ubuntu sudo: ubuntu : TTY=unknown ; PWD=/ ; USER=ubuntu
; COMMAND=/usr/bin/gsettings get org.gnome.desktop.media-handling
automount
5. Xorg Log
Xorg is basically the X window system used in Linux. It’s the base of the graphical
environment for your computer. The xorg log contains details of applications making
use of the graphical environment. This Log file can be used to track which processes
are slowing the computer.
Sample Log Lines
[
37.589]
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[
37.589] Markers: (–) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
The log entries above basically give directions to a user to upgrade to a later versions.
This log file tends to row so easily and sometimes can go to several megabytes. To
ensure that the logging process all together does not slow the computer, the log file
can be resized using the regex code:
$line=”${line/*/”}”
The line replaces all other lines after the ten thousandth line with empty lines thus
making the log file small.
Asusco Aance
17 22:43 Poute la peredes
392261
Manabha tered
17 relor- 00:
09:04:
03:00:00-01:08:00 -2.6.213.24
23317 strated pa to root 15.59.255.2 pers De
Sales and for roes 92.203.189.25 pct 2156 sh2
23 tot dy 1.255.100.15 port30562
2. Gied peased for moderateranerom 91.205.189.15 per 10054
123071 mana pe tot visdro from 1.205.15-19 port 2017
on rasked and for tout
t.205.109.25 pont 29467 ha

Introduction:
As a system administrator, it is important to have a clear understanding of the logs generated by the system and installed applications. Log files contain valuable information that can help identify system errors and troubleshoot other issues. In this assignment, we will examine five log files – three generated by the system (daemon, kern, syslog) and two generated by installed applications (mysql, apache) and for each log, we will describe them, create a useful script for log management, and a regular expression for analyzing the log.

Don't use plagiarized sources. Get Your Custom Essay on
What is the purpose of the syslog log file?
Just from $13/Page
Order Essay

Description:
In this assignment, we will be analyzing five different log files. The first log file we will examine is the syslog.log. This log file contains information logged by various system daemons and helps users detect errors and troubleshoot. The syslog file is a vital mechanism for tracing and identifying any flows within a system and monitoring events, activities, or actions leading to a particular flow. By examining the syslog, we can identify any warning or error messages that could signify potential issues on the system.

We will also examine the dpkg.log file. This log file records all the apt activities, such as installs or upgrades, for the various package managers. We can analyze this file to identify when a software package was installed or removed using the dpkg command.

For each log file we examine, we will create a script that may be useful in managing the log. These scripts can monitor the logs and alert us when unexpected events occur. Additionally, we will create a regular expression that may be useful in analyzing the log. These regular expressions will be part of the scripts and will enable us to identify patterns in the logs that could signify problems.

In the following sections, we will provide sample log entries for each of the five log files we will be examining, as well as the regular expressions and scripts we will create.

Objectives:
– To identify and describe different types of log files
– To develop scripts useful in managing and analyzing log files
– To create regular expressions to extract specific information from log files
– To illustrate the importance of logs for monitoring and troubleshooting system activities

Learning Outcomes:
By the end of this assignment, students will be able to:
– Explain the purpose of different types of log files
– Develop Bash scripts to analyze log files
– Create regular expressions to search for specific information in log files
– Illustrate why logs are important for system monitoring and troubleshooting

Bash Script Assignment:
Identify 5 Log Files

1. sysLog.log
Description: Contains information logged by the various background daemons that runs on the system. Syslog file displays the running system information to help users detect errors and troubleshoot. They provide a mechanism for a user to trace and identify any flows within a given system. They also enable one to monitor events, activities or actions leading to a certain flow.

Sample Log Entries:
– Jun 28 19:16:07 ubuntu kernel: [ 0.000000] KERNEL supported cpus:
– Jun 28 19:16:07 ubuntu kernel: [ 0.000000] Intel GenuineIntel
– Jun 28 19:16:07 ubuntu kernel: [ 0.000000] AMD AuthenticAMD
– Jun 28 19:16:07 ubuntu kernel: [ 0.000000] Centaur CentaurHauls

Script and Regular Expression:
– Script: A Bash script that searches for all entries matching a given date.
– Regular Expression: [[ $line =~ .$string.* ]]
– Description: This regular expression can be useful in case an administrator wants to trace activities from a given date.

2. dpkg Log
Description: This log file contains entries that are logged when a package is installed or removed using dpkg command. It records all the apt activities, such as installs or upgrades, for the various package managers. You can also view synaptic logs through its Graphical user interface.

Sample Log Entries:
– 2014-04-17 01:21:23 status unpacked base-files:amd64 7.2ubuntu5
– 2014-04-17 01:21:23 status half-configured base-files:amd64 7.2ubuntu5
– 2014-04-17 01:21:24 status installed base-files:amd64 7.2ubuntu5
– 2014-04-17 01:21:24 startup archives install

Script and Regular Expression:
– Script: A Bash script that searches for illegal installations or unexpected upgrades.
– Regular Expression: (illegal|unexpected).*(installation|upgrade)
– Description: This regular expression can be useful in troubleshooting unexpected problems that arise from software updates.

3. auth.log
Description: Records user authentication information. This includes information about successful and failed login attempts, as well as other authentication-related events.

Sample Log Entries:
– Apr 18 19:01:51 ubuntu sshd[20142]: Accepted password for user from 192.168.1.1 port 22 ssh2
– Apr 18 19:02:52 ubuntu sshd[20142]: Failed password for user from 192.168.1.1 port 22 ssh2
– Apr 19 07:20:31 ubuntu lightdm: pam_unix(lightdm:session): session opened for user guest by (uid=0)
– Apr 19 07:20:31 ubuntu lightdm: pam_ck_connector(lightdm:session): nox11 mode, ignoring PAM_TTY :0

Script and Regular Expression:
– Script: A Bash script that searches for unsuccessful login attempts.
– Regular Expression: Failed password
– Description: This regular expression can be useful in detecting potential security breaches.

4. apache Log
Description: Records information about web server activity, including requests, responses, and errors.

Sample Log Entries:
– 10.0.0.1 – – [30/Apr/2022:17:12:32 -0700] “GET /index.html HTTP/1.1” 200 800 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299”
– 10.0.0.1 – – [30/Apr/2022:17:12:33 -0700] “GET /images/logo.png HTTP/1.1” 200 3007 “http://example.com/index.html” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299”
– 10.0.0.1 – – [30/Apr/2022:17:12:34 -0700] “GET /about.html HTTP/1.1” 404 209 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299”

Script and Regular Expression:
– Script: A Bash script that searches for 404 errors.
– Regular Expression: “HTTP/1.1″ 404″”

Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
× How can I help you?