Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the public ip on my Apache Amazon EC2 logs #417

Closed
buluxan opened this issue May 20, 2016 · 11 comments
Closed

How to get the public ip on my Apache Amazon EC2 logs #417

buluxan opened this issue May 20, 2016 · 11 comments
Labels

Comments

@buluxan
Copy link

buluxan commented May 20, 2016

hi sir ,

how to get the format logs in below sample , i have tried generate to html file but the ip public (112.215.63.145)) didnt show up only the private ip (172.100.1.170) , i just change my gooacces.conf with different schema but still only i get the private ip , could u pls help me which the format time n date i should custom ,

172.100.1.170 (112.215.63.145) - - [19/May/2016:17:56:50 +0000] "POST /crash/report HTTP/1.1" 200 64 "-" "Dalvik/2.1.0 (Linux; U; Android #5.1; E5333 Build/27.2.B.0.155)"

thx u
lukman

@allinurl
Copy link
Owner

Hello, please try this, it should do it:

log-format %^ (%h) %^[%d:%t %^] "%r" %s %b "%R" "%u"
date-format %d/%b/%Y
time-format %T

@allinurl allinurl changed the title How to get the Public ip on my apache logs ec2 amazon How to get the public ip on my Apache Amazon EC2 logs May 20, 2016
@buluxan
Copy link
Author

buluxan commented May 20, 2016

ok sir, let met try first will update once its success

@buluxan
Copy link
Author

buluxan commented May 20, 2016

hi sir i got this error below :

/log/httpd# goaccess -f access_log -a > testing.html

GoAccess - version 0.9.8 - May 19 2016 16:21:01
Config file: No config file used

Fatal error has occurred
Error occured at: src/settings.c - parse_conf_file - 256
Malformed config value at line: 

@allinurl
Copy link
Owner

Can you please post your config file. Also where is your config file located? You may need to use -p /path/config.file.

@buluxan
Copy link
Author

buluxan commented May 21, 2016

hi sir

here's the configuration file , and also i put the config file in zip file

goaccess -f access_log -a -p /usr/local/etc/goaccess.conf > testing.html

GoAccess - version 0.9.8 - May 19 2016 16:21:01
Config file: /usr/local/etc/goaccess.conf

Fatal error has occurred
Error occured at: src/settings.c - parse_conf_file - 256
Malformed config value at line: 

the config of goaccess.conf was location on below path

/usr/local/etc# ll
total 24
drwxr-xr-x  2 root root  4096 Mei 19 16:21 ./
drwxr-xr-x 10 root root  4096 Des  9 04:17 ../
-rw-r--r--  1 root root 15452 Mei 21 01:39 goaccess.conf

goaccess.conf.zip

@allinurl
Copy link
Owner

Thanks, you will need to remove the leading whitespace on line 82. That should fix the issue.

BTW, I have pushed a commit that will automatically trim leading spaces when parsing the config file. Feel free to rebase from master, otherwise it will be pushed out in the upcoming release.

@buluxan
Copy link
Author

buluxan commented May 21, 2016

will try it , will update it
thx u very much sir

@buluxan
Copy link
Author

buluxan commented May 21, 2016

i got the error display
screenshot from 2016-05-21 22 27 50
when i try opened with firefox browser

GoAccess - 0.9.8 Usage: goaccess [ options ... ] -f log_file [-c][-M][-H][-q][-d][...] The following options can also be supplied to the command: Log & Date Format Options --log-format= - Specify log format. Inner quotes need to be escaped, or use single quotes. --date-format= - Specify log date format. e.g., %d/%b/%Y --time-format= - Specify log time format. e.g., %H:%M:%S User Interface Options -c --config-dialog - Prompt log/date/time configuration window. -i --hl-header - Color highlight active panel. -m --with-mouse - Enable mouse support on main dashboard. --color= - Specify custom colors. See manpage for more details and options. --color-scheme=<1|2> - Color schemes: 1 => Grey, 2 => Green. --html-report-title=

@allinurl
Copy link
Owner

You must be missing a command line option or adding an invalid command line option while outputting to a file. Please, first try to output to a terminal (without > /path/report.html). Once everything looks right, then you may output to a file.

Also, try this:

goaccess -f access_log -a --log-format='%^ (%h) %^[%d:%t %^] "%r" %s %b "%R" "%u"' --date-format='%d/%b/%Y' --time-format='%T' --no-global-config > report.html

@buluxan
Copy link
Author

buluxan commented May 21, 2016

just redownload the goaccess.conf from the branch master and copy the file into my machine ,
its working now , thx you

screenshot from 2016-05-21 23 02 10

@allinurl
Copy link
Owner

That's great! Closing this. Feel free to reopen it if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants