How to analyze Linux logs
There is a lot of information in the log that you need to process, although sometimes it is not easy to extract. In this article, we will introduce some basic log analysis examples that you can do now (you only need to search ). We will also involve some more advanced analysis, but these require your initial efforts to make appropriate settings, which will save a lot of ti
/usr/share/doc/View the Update log of the RPM packageMethod 1: rpmRun the rpm command to check any installed software packages.Note: rpm cannot check the update logs of software packages not installed on the system.$ rpm -q --changelog | more Method 2: RepoqueryUse the repoquery command to check the update logs of software packages that have not been installed in your system.Install repoquery$ sudo yum in
There are several commands for Linux to view logs: Tail, Cat, TAC, head, Echo
A. View Log mode
command format: tail[necessary parameters [select parameters] [file]
This is one of my most common ways to view1.tail
-F Loop Read
-Q does not display processing information
-V display detailed processing information
-c
2.head
Head-n test.log //query log files in the first 10 lines of log;
Head-n -
Linux system logs and their rsyslog service logs are plain text files/var/logs used by the system to record some messages related to the system runtime to save a large number of logs of plain text logs. maintain the running status
In linux, the code for deleting logs 7 days ago (php + shell ). PHP version: Copy the code as follows: *** delete logs 7 days ago * @ param $ logPath * functiondel7daysAgoLog ($ logPath) {if (empty ($ logPath) return; $ handleopendir ($ logPath); PHP version:
The code is as follows:
/*** Delete logs 7 days ago* @ Pa
Everyone may have the need to manage the log, such as the timing of compressed logs, or log more than a certain size automatically split into two files. Have recently received such a small task. Our program uses the C language, using the Log4cpp library to achieve the logging. But the problem is that Log4cpp does not support automatic splitting of logs over a certain amount of hours, and can only cover the
device to see if the file passed through.[Email protected] tmp]# Ls/tmp/rsyncAming-02.txthas been synchronized.In turn, we can also pull this file out of the machine.[Email protected] tmp]# RSYNC-AVP 192.168.1.106::test/aming-02.txt/tmp/123.txtReceiving incremental file listAming-02.txt1159 100% 1.11mb/s 0:00:00 (xfer#1, TO-CHECK=0/1)Sent bytes received 1266 bytes 2622.00 bytes/secTotal size was 1159 speedup is 0.88Also succeeded.Linux system logsThe log records every day of the system's data.
legal authorization. On the sun workstation, he will return a number set in the immutable memory of a machine during manufacturing. Therefore, this is the only system hardware.
For other systems, such as Linux, a value based on the machine network address is returned, which is usually safe enough for authorization.
Logs
Many programs need to record their actions. System programs usually write information t
JavaIf the following information is present, Tomcat is turned offRoot 7010 1 0 Apr19? Finally, start Tomcat./startup.shMethod Two:I don't know what your directory structure is like under Linux. Here are some of the steps I'm going to use to inspire you-cd/tomcat7/logs/ -tail-f catalina.out (catalina.out is the console log file)Tomcat starts off common commands:After booting, shutt
Reprinted from: 50989335Restore demand scenario: Test engineers also want to check the Linux logs, but face a lump of log, in addition to dazzling really no other harvest.Solve demand scenario: Let the keywords in log color or highlight, so that the eyes can focus.There are currently 2 types of highlights in Linux commands that are known to be useful:1. tail-f lo
permissions, owner, group Missingok Monthly Create 0600 root utmp Rotate 1 } #system-specific logs may be Also be configured. #cat/etc/logrotate.d/syslog/var/log/cron//will be cut for the 5 logs of Cron,maillog,messages,secure,spooler/var/log/maillog/var/log/messages/var/log/secure/var/log/spooler{SharedscriptsPostrotate//involves shell command line/bin/kill-hup cat /var/run/syslogd.pid 2gt; /dev/null
Article Title: Use logrotate to manage Linux logs. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
For linux system security, log files
1. Linux System LogDoes the log matter? Yes, no logs. How do we know the status of the system? No logs how to troubleshoot a trouble? The log records a variety of things that happen on a daily basis, which you can use to check for the cause of the error or the traces that the attacker left when it was attacked. The main functions of the log are: audit and monitor
Linux Oracle deletes archive logs
Oracle reported this error today: ORA-00257
Check that the archive logs of Oracle are full. Solution: Two
1. Increase the archive log size. 2. Delete useless archive logs. (select this solution)
In Linux:
Delete archive files in
Linux splits tomcat logs through crontab
Tomcat Catalina Log decisive time will be very large, can not be viewed, there are many kinds of log segmentation methods on the Web. This paper mainly studies the process of segmenting tomcat logs via Linux crontab timing tasks: First Prepare sh execution script
The following
matching command will be executed. ) [[[emailprotected]] #!rpm list all history by screen: [[[emailprotected]]#] | More immediately clears history of all current History commands [[emailprotected]] #history-ccat, tail and watch system all the logs are in the/var/log under their own view (specific use can be self-check, The appendix lists some commonly used logs) Cat/var/log/syslog etc. cat/var/log/*.logtai
matching command will be executed. )[[email protected]] #!rpmList all history on a per-screen basis:MoreImmediately clears the history of all current historical commands[[email protected]] #history-CCat, tail and watchSystem all the logs are under the/var/log to see their own (specific use can be self-check, appendix lists some common logs)Cat/var/log/syslog et Cat/var/log/*.logTail-fIf the log is updated,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.