terminal.cab

Linux Basics Lesson 13 of 38

guestLevel 1Badges and progress0/100 XP, XP to the next levelStreak0

Who is hammering the API?

Detective 80 XP

9 minutes

Learning goals

Everything you need comes from this module. The log is in the format combined: the address is the first field and the requested path is field 7, counting at single spaces. So cut -d' ' -f7 gets you the path.

On a real server, /var/log/nginx belongs to root:adm. You read it with sudo or as a member of the group adm, and lerner is one here.

Steps

Step 1/3: How big is /var/log/nginx/access.log? Find out the number of lines first.

Detective 80 XP

The API has been sluggish since this morning, and the team suspects a scraper. Nobody has numbers, only a feeling. In front of you is the nginx log. Find out who is calling most often and what they are after, and save both, so that the ticket says more than "maybe a bot".

  1. Step 1

    How big is /var/log/nginx/access.log? Find out the number of lines first.

  2. Step 2

  3. Step 3

Loading terminal …

lerner@web-01: ~bash
lerner@web-01:~$

Esc, then Tab leaves the terminal

Step 1 of 3

Cards

  1. Card 1 of 2

    Tap the card or press Space to turn it over.

  2. Card 2 of 2

    Tap the card or press Space to turn it over.

Cheat sheet

The most important command lines of this module on one A4 page, black and white, to print or keep on your phone.