Tag Info

Hot answers tagged

3

When a file is opened, the system assigns a file descriptor to it. While the file is open, it is accessed via this FD. When you run the sed command it truncates the file by copying it to a new file. You can see this because the inode number changes ls -i log 131122 log sed -i "1,200d" log ls -i log 131090 log What's happening is that the file is being ...


3

You should be able to do this by using rsyslog on your systems to send all the logs to a centralised log server. For applications that log via syslog this is fairly straightforward. For applications that log directly to files, rsyslog provides a Text File Input Monitor module that sends lines from a text file to rsyslog for processing. Regarding ...


3

When path references in an Apache configuration are not absolute (i.e. don't start with /) they are relative to the directory set in the ServerRoot directive. A common default for the ServerRoot is /etc/httpd making /etc/httpd/logs your log directory. Most packaged Apache versions create a symbolic link from /etc/httpd/logs to /var/log/httpd. Either the ...


2

Just parse your logfile with grep command. It's clean and simple. grep -i --color email@example.com /var/log/maillog Since you're using iRedMail you can even use AWStats that's builtin on the package. Take a look and check if this is sufficient to your needs: http://awstats.sourceforge.net; and there's a screenshot too: ...


2

You forget to configure the inverse , besides writing your LAN requests to it's own log you need to exclude them from the regular log as well... # Where your access log is defined CustomLog logs/access_log common env=!fromlan Make sure that the SetEnvIf line is declared before the regular access log is.


2

installing a monitoring tool If this is only one box, i would not install any monitoring tool, rather rely on scripts. However if you want to go with monitoring tools, i would pick zabbix [monitoring] & ossec [IDS] doing often the updates (how often?) Depends lets take e.g of recent vulnerability on heartbleed, how would you choose to get ...


2

If it's not in the log files and the mails have been sent, they will be deleted from the queues and are lost.


1

Your sed command will create a new file and write the processed output to that file. Then it will rename the new file to replace the old file. The process will still be writing to the same file you redirected the output to at first. The file is now deleted, but that doesn't prevent a process which has the file open from writing to it. You should start ...


1

When you run the ./myApp &>myApp.log command output is redirected to a new file with the filename myApp.log. When you run your sed -i "1,200d" myApp.log command a new file is created with the name myApp.log. The problem here is that the original command is still writing to the file that was original created, but which has been unlinked and no longer ...


1

I'm using splunk on my work to handle a logs from a bunch of servers, some linux and some windows Highly advise you to look at splunk universal forwarder. With it you can choose, what logs to send and basically you can create any scenario on logs treatment, It's way easier to tune, then rsyslog, there is a deployment server, that can help you to manage ...


1

Did you look at the format of the dates in you apache logs ? On the systems I have to hand (CentOS) that have their access logs in /var/log/httpd the date format is 15/Jun/2014:11:48:27 +0000 If yours is the same then you need date -d -1hour +'%d/%b/%Y:%H' as your date command. If it's different then you need to show us the format that the log file ...


1

You are doing a recursive grep (-R) - which is useless in this case- I presume you don't have any subdirs under /var/log/httpd (if that's standard distro). What you want to do is discard everything before a line that has timestamp from hour ago. Also, access and error logs typically have different timestamps in them. So, for example, access log has the ...


1

It looks like somebody's robot accessing the HTTP server on your machine. My gut says it's probably harmless. Searching Google for those keyword returns other people who are seeing it in their logs, too. It's good to be vigilant and it's good to hear that you're watching your logs so closely. In this case, I suspect you're alright.



Only top voted, non community-wiki answers of a minimum length are eligible