goaccess analystis nginx log - parseing url - nginx

I am using goaccess statistics my ngnix log. But the problem is that the same url have difference parameter.
115.*.*.115 - - [01/Nov/2013:06:15:29 +0000] "GET /this/is/example/test.html?ver=53&q=aaaaaa HTTP/1.1" 200 64 "-" "-"
115.*.*.115 - - [01/Nov/2013:06:15:29 +0000] "GET /this/is/example/test.html?ver=53&q=bbbbbb HTTP/1.1" 200 64 "-" "-"
I want to ignore the parameter after just statistics url like "/this/is/example/test.html".
How to do that or some other tools can do it?
Thanks.

perl -p -e 's/\?.*(\sHTTP)/$1/' log | goaccess
should do it.

Related

The visualizer does not get a response from the browser after it outputs a picture

How do I configure the visualizer so it does not hang after sending a picture to the browser?
DisplaCy sends the picture to the browser, it is drawn in the browser, but then they do not respond to keystrokes and buttons. In the browser, it is only manages to close the page with the picture, but this is not sent to spaCy. The program waits for a response but does not get one, I have to crash execution to continue. After kernel`s interrupting execution continues normally. Execution in Spyder environment.
My actions: start the browser, Spyder, start the visualization program, after appearing in the console "Serving on http://0.0.0.0:5000 ..." enter the address in the browser - a picture appears and in the console lines: "127.0.0.0.1 - - [09/Feb/2023 19:06:28] "GET / HTTP/1.1" 200 3400". Further - only close.
import spacy
from spacy import displacy
print('\n begin') #
nlp = spacy.load("en_core_web_sm")
doc = nlp("This is a sentence.")
displacy.serve(doc, style="dep", options={"compact": True})
print('\n end') #`
console content:
begin
Using the 'dep' visualizer
Serving on http://0.0.0.0:5000 ...
127.0.0.1 - - [09/Feb/2023 19:06:28] "GET / HTTP/1.1" 200 3400
127.0.0.1 - - [09/Feb/2023 19:06:29] "GET /favicon.ico HTTP/1.1" 200 3400
127.0.0.1 - - [09/Feb/2023 19:06:29] "GET /favicon.ico HTTP/1.1" 200 3400
Shutting down server on port 5000.
end`

Error getting data from Graphite 500 Internal Server Error (Intermittent)

I need some help tracking down a sporadic http status 500 internal server error when using Graphite.
The server is running on Ubuntu 16.04, Graphite version 0.9.15.
10.0.0.10 - - [09/Jul/2017:08:07:14 -0500] "GET /render?from=-3minute&target=aliasByNode%28divideSeries%28hosts.Test.metric1.mean%2C+hosts.Test.metric2.mean%29%2C+1%29&format=json HTTP/1.1" 500 1237 "-" "python-requests/2.7.0 CPython/2.7.12 Linux/4.4.0-62-generic"
The same request works again without any modification.

Openshift Wordpress Service Temporary Unavaliable. Can't restart application

I'm having a problem on a Wordpress instance I need to show to a client.
I'm using free gear. The app is not intended for production yet. Everything was working fine, I made a child-theme. Have been working on this page for about a month. Since yesterday morning I'm getting: Service Temporarily Unavailable when I try to access the page. It isn't the first time this happens, but it never lasted more then a few hours. Now it has been almost 48 hours. I need to show her the demo but I can't make it work.
Here is the output of the tail command:
C:\Users\Joao Paulo\Projetos\GibbInsurance\sources\demo>rhc tail demo
DL is deprecated, please use Fiddle
==> app-root/logs/mysql.log <==
140820 22:03:29 [Note] /opt/rh/mysql55/root/usr/libexec/mysqld: ready for connec
tions.
Version: '5.5.37' socket: '/var/lib/openshift/539c92755973caa1f000044c/mysql//s
ocket/mysql.sock' port: 3306 MySQL Community Server (GPL)
140823 18:05:36 [Note] /opt/rh/mysql55/root/usr/libexec/mysqld: Normal shutdown
140823 18:05:36 [Note] Event Scheduler: Purging the queue. 0 events
140823 18:05:36 InnoDB: Starting shutdown...
140823 18:05:39 InnoDB: Shutdown completed; log sequence number 9866622
140823 18:05:39 [Note] /opt/rh/mysql55/root/usr/libexec/mysqld: Shutdown complet
e
chown: changing ownership of `/var/lib/openshift/539c92755973caa1f000044c/mysql/
/stdout.err': Operation not permitted
140823 18:05:39 mysqld_safe mysqld from pid file /var/lib/openshift/539c92755973
caa1f000044c/mysql/pid/mysql.pid ended
140823 18:05:39 mysqld_safe mysqld from pid file /var/lib/openshift/539c92755973
caa1f000044c/mysql/pid/mysql.pid ended
==> app-root/logs/php.log <==
10.6.135.27 - - [23/Aug/2014:16:10:37 -0400] "HEAD / HTTP/1.1" 200 - "-" "Ruby"
10.6.135.27 - - [23/Aug/2014:16:10:37 -0400] "HEAD / HTTP/1.1" 200 - "-" "Ruby"
10.6.135.27 - - [23/Aug/2014:17:10:38 -0400] "POST /wp-cron.php?doing_wp_cron=14
08828238.7940719127655029296875 HTTP/1.1" 200 - "-" "WordPress/3.9.2; http://dem
o-gibbinsurance.rhcloud.com"
10.6.135.27 - - [23/Aug/2014:17:10:38 -0400] "HEAD / HTTP/1.1" 200 - "-" "Ruby"
10.6.135.27 - - [23/Aug/2014:17:10:39 -0400] "HEAD / HTTP/1.1" 200 - "-" "Ruby"
- - - [23/Aug/2014:17:10:41 -0400] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.15
(Red Hat) (internal dummy connection)"
- - - [23/Aug/2014:18:05:41 -0400] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.15
(Red Hat) (internal dummy connection)"
- - - [23/Aug/2014:18:05:41 -0400] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.15
(Red Hat) (internal dummy connection)"
- - - [23/Aug/2014:18:05:41 -0400] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.15
(Red Hat) (internal dummy connection)"
[Sat Aug 23 18:05:41 2014] [notice] caught SIGWINCH, shutting down gracefully
Interrupted
Terminate batch job (Y/N)? Y
When I try to restart the server, this is what I'm getting:
C:\Users\Joao Paulo\Projetos\GibbInsurance\sources\demo>rhc app restart -a demo
DL is deprecated, please use Fiddle
Failed to execute: 'control restart' for
/var/lib/openshift/539c92755973caa1f000044c/mysql
Failed to execute: 'control restart' for
/var/lib/openshift/539c92755973caa1f000044c/php
I appreciate any help.
Thank's a lot!
Try doing a force-stop on your application, and then a start and see if that helps. You should also try checking your quota and make sure that you are not out of disk space on your gear.

Separate get request being generated for every request

I have a site that's embedded inside an iframe.
On occasion I'm seeing a phantom get request generated for each get or post.
The nginx logs show this occurring, notice there is a get request sent immediately after the post:
XX.XXX.XXX.XX - - [06/Oct/2012:20:55:47 +0000] "POST /website_widget/users HTTP/1.1" 200 1996 "http://subdomain.mysite.com/website_wi
dget/users/sign_up" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
XX.XXX.XXX.XX - - [06/Oct/2012:20:55:47 +0000] "GET /website_widget/users HTTP/1.1" 404 781 "http://subdomain.mysite.com/website_widg
et/users" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
XX.XXX.XXX.XX - - [06/Oct/2012:20:55:53 +0000] "POST /website_widget/users HTTP/1.1" 200 1993 "http://subdomain.mysite.com/website_wi
dget/users" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
XX.XXX.XXX.XX - - [06/Oct/2012:20:55:53 +0000] "GET /website_widget/users HTTP/1.1" 404 781 "http://subdomain.mysite.com/website_widg
et/users" "Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1"
This also happens with standard get requests too. From my rails logs I can see:
Started GET "/website_widget/users/sign_in" for XX.XX.XXX.XX at 2012-10-06 20:45:35 +0000
[b7e895726057452d0af6a2ac5cd1668d] Processing by WebsiteWidget::MyController#new as HTML
Started GET "/website_widget/users/sign_in" for XX.XX.XXX.XX at 2012-10-06 20:45:37 +0000
[b20e57fcc205ee6cf958589ab1660c9f] Processing by WebsiteWidget::MyController#new as */*
Notice in the */* for the second log entry, which suggests the mime type is not set to html or not set at all.
Had anyone come across this kind of thing before? Or got any idea how I can debug it further. I'm proving quite difficult to recreate.
So it looks like this was caused by a firefox plugin. Probably a site ranking plugin of some description.

How can I measure my (SAMP) server's bandwidth usage?

I'm running a Solaris server to serve PHP through Apache. What tools can I use to measure the bandwidth my server is currently using? I use Google analytics to measure traffic, but as far as I know, it ignores file size. I have a rough idea of the average size of the pages I serve, and can do a back-of-the-envelope calculation of my bandwidth usage by multiplying page views (from Google) by average page size, but I'm looking for a solution that is more rigorous and exact.
Also, I'm not trying to throttle anything, or implement usage caps or anything like that. I'd just like to measure the bandwidth usage, so I know what it is.
An example of what I'm after is the usage meter that Slicehost provides in their admin website for their users. They tell me (for another site I run) how much bandwidth I've used each month and also divide the usage for uploading and downloading. So, it seems like this data can be measured, and I'd like to be able to do it myself.
To put it simply, what is the conventional method for measuring the bandwidth usage of my server?
This depends on your setup. If you have a (near-)dedicated physical interface for your web server you could gather stats straight from the interface.
Methods to do this could include SNMP (try net-snmp) or "ifconfig", combined with RRDTool or simple logging to flat files.
An alternative is using the Apache log, which could look like this:
192.168.101.155 - - [17/Apr/2005:20:39:19 -0700] "GET / HTTP/1.1" 200 1456
192.168.101.155 - - [17/Apr/2005:20:39:19 -0700] "GET /apache_pb.gif HTTP/1.1" 200 2326
192.168.101.155 - - [17/Apr/2005:20:39:19 -0700] "GET /favicon.ico HTTP/1.1" 404 303
192.168.101.155 - - [17/Apr/2005:20:39:42 -0700] "GET /index.html.ca HTTP/1.1" 200 1663
192.168.101.155 - - [17/Apr/2005:20:39:42 -0700] "GET /apache_pb.gif HTTP/1.1" 304 -
192.168.101.155 - - [17/Apr/2005:20:39:43 -0700] "GET /favicon.ico HTTP/1.1" 404 303
192.168.101.155 - - [17/Apr/2005:20:40:01 -0700] "GET /apache_pb.gif HTTP/1.1" 304 -
192.168.101.155 - - [17/Apr/2005:20:40:09 -0700] "GET /apache_pb.gift HTTP/1.1" 404 306
192.168.101.155 - - [17/Apr/2005:20:40:09 -0700] "GET /favicon.ico HTTP/1.1" 404 303
The last number is the amount of bytes transferred, excluding the header(!). See Apache Log Docs.
I am just guessing, but I think the usual approach is to use the same tools and services that are used to deliver QoS features. QoS == Quality of Service. Somewhere on the server itself, or on the network routers around the server, there will be services enabled that measure the size of the packets flowing out of your server. These same services can be used to limit the amount of bandwidth for customers that need to have such limitations enforced. I have not heard of an application that can be run on your server that measures bandwidth. I think it should be possible to create such an app, but that's not the usual way that such measurements are collected. I suspect this answer will end up not being solaris-specific.

Resources