TGStat
TGStat
Type to search
Advanced channel search
  • flag English
    Site language
    flag Russian flag English flag Uzbek
  • Sign In
  • Catalog
    Channels and groups catalog Regional compilations Thematic compilations Платные каналы Search for channels
    Add a channel/group
  • Ratings
    Rating of channels Rating of groups Posts rating
    Ratings of brands and people
  • Analytics
  • Search by posts
  • Telegram monitoring
  • Promotion
    Advertising through Yandex Business Advertising in channels through TGStat Agency Advertising on TGStat.ru website
CodeGuard: Archive

4 Oct, 19:10

Open in Telegram Share Report

🤔 Одна команда, которая найдёт топ-10 IP в логе

Задача: в access-логе найти, кто долбит сервер чаще всех. Открывать в редакторе — самоубийство.
cut -d' ' -f1 access.log | sort | uniq -c | sort -rn | head -10

Что происходит:
cut -d' ' -f1 — берёт первое поле (IP)
sort — сортирует (без него uniq не работает)
uniq -c — считает повторы
sort -rn — сортирует по числу
head -10 — топ-10

Результат:
8432 185.234.72.11
1204 91.201.43.7
872 45.155.204.19
8432 запроса с одного IP за день — это не человек. Это бот.

Запомни связку:
cut -d' ' -fN файл | sort | uniq -c | sort -rn | head
Меняешь номер поля — и считаешь что угодно: топ URL, топ User-Agent, топ кодов ответа.

😈 CodeGuard: Archive

384 0 19 4
Catalog
Channels and groups catalog Channels compilations Search for channels Add a channel/group
Ratings
Rating of Telegram channels Rating of Telegram groups Posts rating Ratings of brands and people
API
API statistics Search API of posts API Callback
Our channels
@TGStat @TGStat_Chat @telepulse @TGStatAPI
Read
Академия TGStat Telegram Research 2019 Telegram Research 2021 Telegram Research 2023
Contacts
Справочный центр Support Email Jobs
Miscellaneous
Terms and conditions Privacy policy Public offer
Our bots
@TGStat_Bot @SearcheeBot @TGAlertsBot @tg_analytics_bot @TGStatChatBot