Changed README & install.sh
This commit is contained in:
parent
9fd380a547
commit
f71c62d730
4 changed files with 19 additions and 5 deletions
BIN
GeoLiteCity.dat
BIN
GeoLiteCity.dat
Binary file not shown.
14
README.md
14
README.md
|
@ -9,8 +9,8 @@ GeoStat is a Python script for parsing Nginx and Apache logs files and getting G
|
||||||
- Parsing incoming ip's from web server log and convert them in to GEO metrics for the InfluxDB.
|
- Parsing incoming ip's from web server log and convert them in to GEO metrics for the InfluxDB.
|
||||||
- Used standard python lib's for the maximus compatibility.
|
- Used standard python lib's for the maximus compatibility.
|
||||||
- Having an external **settings.ini** for comfortable changing parameters.
|
- Having an external **settings.ini** for comfortable changing parameters.
|
||||||
|
|
||||||
Json format that script send to InfluxDB looks like:
|
Json format that script send to InfluxDB looks like:
|
||||||
```
|
```
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,7 @@ Json format that script send to InfluxDB looks like:
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
As you can see there is two tags field, so you can build dashboards using geohash or just country code, count for any metric equal 1. This script don't parse log file from begining but parse it line by line after runing. So you can build dashboards using "count" of geohashes or country codes after some time will pass.
|
As you can see there is two tags field, so you can build dashboards using geohash or just country code, count for any metric equal 1. This script don't parse log file from begining but parse it line by line after runing. So you can build dashboards using "count" of geohashes or country codes after some time will pass.
|
||||||
|
|
||||||
### Tech
|
### Tech
|
||||||
|
|
||||||
|
@ -55,7 +55,13 @@ $ cp geostat.service.template geostat.service
|
||||||
$ vi geostat.service
|
$ vi geostat.service
|
||||||
$ cp geostat.service /lib/systemd/system/
|
$ cp geostat.service /lib/systemd/system/
|
||||||
```
|
```
|
||||||
3) Then enable and start service
|
4) Download latest GeoLiteCity.dat from MaxMind
|
||||||
|
```sh
|
||||||
|
$ wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
|
||||||
|
$ gunzip GeoLiteCity.dat.gz
|
||||||
|
$ rm GeoLiteCity.dat.gz
|
||||||
|
```
|
||||||
|
5) Then enable and start service
|
||||||
```sh
|
```sh
|
||||||
$ systemctl enable geostat.service
|
$ systemctl enable geostat.service
|
||||||
$ systemctl start geostat.service
|
$ systemctl start geostat.service
|
||||||
|
|
|
@ -76,4 +76,4 @@ if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
main()
|
main()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
os.system('clear')
|
sys.exit(0)
|
||||||
|
|
|
@ -4,6 +4,14 @@
|
||||||
## Installetion script for GeoStat
|
## Installetion script for GeoStat
|
||||||
## Alexey Nizhegolenko 2018
|
## Alexey Nizhegolenko 2018
|
||||||
##
|
##
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Downloading latest GeoLiteCity.dat from MaxMind"
|
||||||
|
sleep 1
|
||||||
|
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
|
||||||
|
gunzip GeoLiteCity.dat.gz
|
||||||
|
rm GeoLiteCity.dat.gz
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Creating virtual ENV and installing requirements..."
|
echo "Creating virtual ENV and installing requirements..."
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
Loading…
Reference in a new issue