I want to know on a analysis layer from apache logs which can tell me if the # of concurrent logins (using same username) has exceeded e.g more then 4.
Is such a thing can be automated or it requires manual analysis.
Apache2 Logs Does not Support Concurrent Users
AS the title suggests indeed the default logging system that Apache2 uses does not support logging of session times also referred as concurrent users. It logs the accessing of files and errors. You will need to install some kind of system that monitors and logs real time events.
Limited Monitoring of Logs (ApacheTop)
You can monitor basis usage of the apache2 logs but again this will not show the detail I think your looking for. To install Apachetop simply run:
Example above is displayed for Debian and Ubuntu, change the command to your preferred Linux if required to do so.
Then run "apachetop" to view some information live, but again it's not that useful.
Additionally to take a glimpse on this working take a look at it monitoring my design blog:
As you can see it doesn't provide much information.
Apache2 Mod Status
While apache2 does not log concurrent users it is possible by installing a mod_status application which setups a monitoring page which details this information. You can install this by doing:
For further information regarding the install and usage of a2enmod status I suggest you check out Enabling and using Apache's mod_status on Ubuntu
There are many online real time web monitoring services online that you can use taking the headache away of installing your own setup, this is by far the easiest method to install and often provides more information about where they came from, what they clicked and you can view it all in read time. I suggest you take a look some of these:
I recommend TraceWatch