Read Logs Like a Detective
Every login, download and connection leaves a record behind. Log analysis is reading those records like a detective reads a crime scene: timestamps, IP addresses and failed passwords instead of fingerprints.
When ransomware hits at 3 AM or data quietly flows to an unknown server, the logs show how it happened and who did it. By the end of this guide you'll know what's inside a log, how to read one, and the five red flags that mean "look closer."
What is a log?
A log is a diary that computers write about themselves, automatically, every second. Someone signs in: logged. A file is downloaded: logged. A device connects to the internet: logged.
You don't need to understand every log. Even experienced analysts don't. What matters is learning to spot patterns, the same way a detective doesn't read every page of a case file but knows which details matter.
The 5 parts of a log
Most log lines answer the same five questions. Not every log has all five, but this is what to look for.
| Question | Part | What it tells you | Example |
|---|---|---|---|
| When? | Timestamp | When it happened. Always start here. | 2025-10-22 03:15:42 |
| Where? | Source | Which system wrote the log | SERVER-DB01, firewall-prod, 10.0.1.50 |
| What? | Event type | The action that happened | Login_Failed, file_deleted |
| Who? | User or actor | The person, account or program behind it | admin, a service account |
| Did it work? | Outcome | Success or failure. Failures are often the most interesting. | Failed |
Put together, one line looks like this:
2025-10-22 03:15:42 | SERVER-DB01 | Login_Failed | User: admin | Source IP: 192.168.1.100
In plain English: at 3:15 AM, someone at IP address 192.168.1.100 tried to sign in to SERVER-DB01 as "admin" and failed.
Read a log in 4 steps
Here's a short case to practice on. Read the lines, then follow the steps.
2025-10-22 03:14:05 | SERVER-DB01 | Login_Failed | User: admin | Source IP: 192.168.1.100
2025-10-22 03:14:09 | SERVER-DB01 | Login_Failed | User: admin | Source IP: 192.168.1.100
2025-10-22 03:14:12 | SERVER-DB01 | Login_Failed | User: admin | Source IP: 192.168.1.100
2025-10-22 03:15:42 | SERVER-DB01 | Login_Success | User: admin | Source IP: 192.168.1.100
2025-10-22 03:17:10 | SERVER-DB01 | File_Download | User: admin | customer_list.csv (2.4 GB)
- Check the time. 3:14 AM. Is anyone supposed to be working on this server in the middle of the night?
- Look for repetition. Three failed logins in seven seconds from the same address. One failure is a typo. A burst like this is someone guessing.
- Watch for the turn. The failures stop and a success appears. That usually means the guess worked.
- Follow what happens next. Two minutes later, "admin" downloads a 2.4 GB customer file. Now you have a story: someone guessed the admin password at 3 AM and took customer data.
That last step is the one beginners skip. A single log line is a clue. The lines around it are the story.
5 red flags every analyst should know
Each of these is worth a closer look. None of them proves an attack on its own, so check for the innocent explanation before you sound the alarm.
| Red flag | What it looks like | Could be innocent if... |
|---|---|---|
| Failed logins, then a success | Several failures, then a login that works | The user forgot their password and finally got it right (check the IP and time) |
| After-hours activity | Admin accounts active at 3 AM, big weekend file transfers, accounts created overnight | It's planned maintenance or a scheduled backup |
| Impossible travel | Signed in from New York at 9:00 AM, then China at 9:05 AM | A VPN, cloud proxy or phone syncing makes the location look wrong |
| New or changed accounts | A surprise admin account, sudden permission changes, an old account turned back on | IT made the change and has a ticket for it |
| Unusual programs or connections | Programs running from temp folders, servers reaching out to the internet, odd ports | New software that hasn't been documented yet |
Detective habits
- Know what normal looks like. An admin logging in at 2 AM for planned maintenance is normal. A regular user suddenly downloading 50 GB when they usually move a few megabytes is not. Write down what's typical so the odd stuff jumps out.
- Start broad, then narrow. Filter by a username, an IP address or an event type. Only look at the logs that matter to your case.
- Write down your searches. If you can't retrace your steps, no one can check your work, including future you.
- Read logs in isolation. One line means little. The lines before and after it tell the story.
- Skip the timestamps. Time is what connects one event to the next.
- Treat every alert as an emergency. Most alerts are routine. Learning to tell routine from real is what keeps analysts sharp instead of burned out.
Your investigation checklist
Run through these six questions every time something looks off.
- What triggered the alert?
- When did it happen?
- Who was involved?
- Has this happened before?
- Does it match known bad behavior?
- Do I need to escalate it?
Try it on your own accounts
You don't need a company server to practice. Your Google, Microsoft and Apple accounts keep a log of every sign-in, and checking them takes five minutes. Look for the same red flags: a device you don't own, a city you've never been to, or a sign-in at a time you were asleep.
| Account | Where to look | What it shows |
|---|---|---|
| myaccount.google.com, then Security, then Security Checkup | Recent security activity from the last 28 days, plus every device signed in | |
| Microsoft | account.microsoft.com, then Security, then Recent activity | Each sign-in from the past 30 days, with device and location, including failed ones |
| Apple | account.apple.com, then Devices (or on iPhone: Settings, then your name) | Every device currently signed in to your Apple Account |
Found something you don't recognize? Change that account's password from a device you trust, sign the unknown device out, and turn on two-step sign-in. If it's a work or school account, tell IT. That's escalating, the last step on your checklist.
Resources
- Have I Been Pwned: check if your email showed up in a data breach. Also on our Tools page.
- CISA Secure Our World: the U.S. government's four simple steps to stay safe online.
- Google Security Checkup: a guided review of your Google account, including its sign-in log.
Sources for the account steps: Google Security Checkup guide, Microsoft Recent activity page, Apple device list.
See something strange on your phone or account? Bring it to either store and we'll check, clean and secure it.