How Send access Log only username and Ip address

Alles, was den Apache betrifft, kann hier besprochen werden.

How Send access Log only username and Ip address

Postby ramin_malek » 07. March 2021 16:10

Hi Dear friends I used apache For web server on cacti Now i want send only username and Ip address that login to the web Page Cacti To remote log server
HoW can do this with Custom Log ? or another Way
Please Help Me
ramin_malek
 
Posts: 6
Joined: 07. March 2021 16:08
XAMPP version: 2.17
Operating System: Centos

Re: How Send access Log only username and Ip address

Postby Nobbie » 07. March 2021 20:10

ramin_malek wrote:HoW can do this with Custom Log ?


https://httpd.apache.org/docs/2.4/mod/m ... ml#formats
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: How Send access Log only username and Ip address

Postby ramin_malek » 08. March 2021 08:13

Thank For Reply In this case If i want set username By ip address login to remote log server
What syntax "%a %u " @Ipadress-Server-Log:514 ?
?? this is true?
ramin_malek
 
Posts: 6
Joined: 07. March 2021 16:08
XAMPP version: 2.17
Operating System: Centos

Re: How Send access Log only username and Ip address

Postby Nobbie » 08. March 2021 11:28

Simply try.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: How Send access Log only username and Ip address

Postby ramin_malek » 11. March 2021 19:55

I Try But Not Sucess
If I want For example Send Username and ip address login To Apache ( Cacti Interface )Send To log server 192.168.10.1
What Is Syntax In httpd config ?
Please help me
ramin_malek
 
Posts: 6
Joined: 07. March 2021 16:08
XAMPP version: 2.17
Operating System: Centos

Re: How Send access Log only username and Ip address

Postby Nobbie » 12. March 2021 01:10

This is not a cacti support forum, sorry. I dont know cacti at all.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: How Send access Log only username and Ip address

Postby ramin_malek » 12. March 2021 06:58

Please Try example for apache only thanks
ramin_malek
 
Posts: 6
Joined: 07. March 2021 16:08
XAMPP version: 2.17
Operating System: Centos

Re: How Send access Log only username and Ip address

Postby ramin_malek » 12. March 2021 07:02

For apache under custom log on config file
i try "%a %u" @192.168.10.1
But donnot send any log username and Remote ip address to the Rsyslog
ramin_malek
 
Posts: 6
Joined: 07. March 2021 16:08
XAMPP version: 2.17
Operating System: Centos

Re: How Send access Log only username and Ip address

Postby Nobbie » 12. March 2021 12:37

I changed httpd.conf:

<IfModule log_config_module>
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
# LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%a %u" common
...


I deleted access_log, restart Apache, now my access_log looks so:

::1 -
::1 -
::1 -
::1 -
::1 -
::1 -
::1 -
::1 -
::1 -
::1 -
::1 -
::1 -
::1 -
::1 -
::1 -


etc.

Thats perfectly ok, ::1 is IP for localhost for IPv6 and "-" is empty username, as i dont have any login, there is no username. I should create an Basic Authentication, but i dont need that thing. You see, it works as it should.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: How Send access Log only username and Ip address

Postby ramin_malek » 15. March 2021 08:09

I want Send Direct to Remote syslog I used this
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" @192.168.10.1:514

Ip address Of my syslog is 192.168.10.1 but donnot work
ramin_malek
 
Posts: 6
Joined: 07. March 2021 16:08
XAMPP version: 2.17
Operating System: Centos

Re: How Send access Log only username and Ip address

Postby Altrea » 15. March 2021 08:11

ramin_malek wrote:but donnot work

We cannot help for issues like "donnot work", sorry.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to Apache

Who is online

Users browsing this forum: No registered users and 24 guests