{"id":21058761,"url":"https://github.com/oros42/ip-count.ries","last_synced_at":"2025-07-05T15:14:31.954Z","repository":{"id":59285378,"uuid":"89600896","full_name":"Oros42/IP-count.ries","owner":"Oros42","description":"Count IP and sort countries from log","archived":false,"fork":false,"pushed_at":"2017-05-02T10:21:56.000Z","size":9,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T17:39:27.361Z","etag":null,"topics":["apache2","country","geoip","ipv4","log","nginx"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Oros42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-27T13:31:26.000Z","updated_at":"2024-08-12T19:29:26.000Z","dependencies_parsed_at":"2022-09-22T11:42:03.284Z","dependency_job_id":null,"html_url":"https://github.com/Oros42/IP-count.ries","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oros42%2FIP-count.ries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oros42%2FIP-count.ries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oros42%2FIP-count.ries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Oros42%2FIP-count.ries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Oros42","download_url":"https://codeload.github.com/Oros42/IP-count.ries/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254447803,"owners_count":22072754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache2","country","geoip","ipv4","log","nginx"],"created_at":"2024-11-19T17:09:02.374Z","updated_at":"2025-07-05T15:14:31.942Z","avatar_url":"https://github.com/Oros42.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IP count.ries\nCount IP and sort countries from log\n\nSetup\n-----\n\n```bash\nsudo apt install geoip-bin\nwget https://raw.githubusercontent.com/Oros42/IP-count.ries/master/IP-count.ries.sh -O IP-count.ries.sh\nchmod +x IP-count.ries.sh\n```\n\nRun\n---\n\n```bash\n./IP-count.ries.sh \u003cINPUT_LOG_FILE\u003e \u003cOUPUT_DIR\u003e\n```\n  \nOutput :  \n\u003cOUPUT_DIR\u003e/ipv4.csv # list of unique IP  \n\u003cOUPUT_DIR\u003e/countries.csv # list of countries and count unique IP  \n  \nExample\n-------\n```bash\n$ ./IP-count.ries.sh /var/log/apache2/access.log.1 ./out_exemple.net/\n```\n```bash\n$ cat ./out_exemple.net/ipv4.csv\n31.199.169.45\n66.249.76.45\n66.249.76.46\n66.249.76.47\n79.108.248.111\n89.163.146.102\n89.163.146.112\n91.196.50.33\n91.45.255.225\n104.236.219.177\n139.162.113.204\n139.162.78.135\n169.54.244.89\n180.97.106.37\n183.56.168.163\n185.2.83.33\n191.96.249.97\n192.186.3.75\n193.63.58.83\n196.52.43.62\n208.43.225.85\n220.135.159.86\n```\n```bash\n$ cat ./out_exemple.net/countries.csv\n10,US, United States\n3,DE, Germany\n2,CN, China\n1,TW, Taiwan\n1,PL, Poland\n1,NL, Netherlands\n1,IT, Italy\n1,GB, United Kingdom\n1,ES, Spain\n1,CL, Chile\n```\n```bash\n$ wc -l ./out_exemple.net/countries.csv\n10 out_exemple.net/countries.csv\n```\n  \nTIP\n---\nPut this script in cron.  \nExample :  \n```bash\n$ contrable -e\n10 8 * * * /home/me/IP-count.ries/IP-count.ries.sh /var/log/apache2/my_website.log.1 /home/me/IP-count.ries/my_website/\n```\nNow your goal is to have all countries in the world ^_^  \n\nExample of interface\n--------------------\n  \nSee https://github.com/Oros42/IP-count.ries_interface  \n  \n![screenshot0](https://ecirtam.net/countries/screenshot.png)  \n[Demo](https://ecirtam.net/countries/)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foros42%2Fip-count.ries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foros42%2Fip-count.ries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foros42%2Fip-count.ries/lists"}