Forum Discussion

Dark_Knight666's avatar
Dark_Knight666
Icon for Bronze III rankBronze III
2 months ago
Solved

Web Log Analysis: Ep.5 – Searching Web Server Logs using Linux CLI

Hello, I was wondering if I could please get me help in the right direction.  So I'm on Q3 for this lab and a little confused as to how to combine my commands in order to answer the question?  So ...
  • netcat's avatar
    2 months ago

    Well, the idea of the lab seems to be: Use "cut" to extract the IP address from the logs, and then count the unique values.
    Another tool that you'll love or hate is awk. One of the most basic commands is

    awk '{print $1}' 

    Complete example:

    echo "a b c" | awk '{print $2}'
    b

    It is much more versatile than cut, but not needed for this lab. Yet, I used it.