Free plan available. Set up in minutes with the collectors you already use. Start free
Logthread

Guide

Anomaly detection: unusual for this hour of the week

A fixed threshold is either too tight at the Monday-morning peak or too loose at 3 a.m. Logthread learns what is usual for each hour of the week for every series you watch, and tells you when a value leaves that band, with how far and why.

Open Respond → Alerts → Anomalies. Besides the usual band for each hour, a watch can flag something an entity never did before, an entity far from its peers, clients behaving like bots, scrapers or AI agents or ingest about to reach its limit, and every anomaly is explained.

What you can watch#

One watch covers a measure for every value at once (up to 50 series), so you do not write one rule per service.

WatchSeriesStep
Log linesLines per hour, for each value of a field: service, environment, route, organisation, any field1 hour
Failed linesLines that failed (error severity, or HTTP 500 and above) per hour, for each value1 hour
Error rateFailed lines ÷ lines per hour, for each value (hours with fewer than 20 lines never alert)1 hour
A metricAny metric, including your log metrics (logs.<name>), per group (service, host, route, ...) with filters: average, rate, p50, p90, p95, p99, max, min or last15 or 60 minutes

Log series are counted by the hour lines arrived, from the hourly field summaries of Every dimension, so a watch never re-reads your raw logs. A metric series is exactly what the Metrics chart draws at the same interval: the value an alert names is the value you see on the chart.

How the usual band is learned#

For each series, from the last 28 days:

  • Slot: each hour of the week in UTC, for example Tuesday 10:00 UTC. Slots are UTC for every workspace, so they never shift with daylight saving; every explanation names the hour with "UTC".
  • Samples: the values of that hour and the hour either side, on that weekday in each of the last 4 weeks. With fewer than 14 days of history, the same hour of the day on every day is used instead. With fewer than 3 days, the series is still learning and never alerts.
  • Expected value: the median of the samples. Spread: 1.4826 × the median absolute deviation, but never smaller than a floor (for counts the square root of the expected value, or 5% of it, at least 1 line; for an error rate 5% of it, at least 0.2 points), so a very steady series does not alert on noise.
  • Band: expected ± k × spread, with k = 5 (low sensitivity), 4 (medium, the default) or 3 (high). Counts and rates never go below 0.

A value is unusual when it is outside the band in the direction you chose (up, down or both; up by default for failed lines and error rate) and, for counts, differs from the expected value by at least the minimum change (default 10 lines). Bands are refreshed every hour for metric watches and every 6 hours for log watches, and a changed watch is learned again at once.

Every number is reproducible: the expected value, band and score come from the same hourly summaries or chart values you can query yourself.

Set up a watch#

  1. Choose what to watch: log lines, failed lines or error rate and the field to split by, or a metric, its aggregation and what to group by. Optionally limit it to named values.
  2. Preview the past 30 days: each of the last 30 days is scored against the band learned from the 28 days before it. You see how many alerts the watch would have raised, for each series, and the band drawn over the last 7 days. Adjust sensitivity, direction or the minimum change until the count is right.
  3. Choose who hears: channels, severity and repeat interval, as for any alert rule.
  4. Activate. A new watch shows Learning until its first baseline is stored, usually within a minute. Paused and learning watches are listed on Home.

When a series is unusual#

  • Anomalies lists it first, with the sentence "api: 3.4× the usual Tue 10:00 UTC (expected 120–180, was 512)" and its chart with the band.
  • An incident opens for that series (one per series, like grouped alert rules), reaches the watch's channels and joins the matching Situation. It resolves when the series is back in its band.
  • What drives this? opens on the unusual hour against the same time before, ranking the values of every field that explain the change.
  • Why is it unusual? on the series compares the unusual step with the same hour last week (or yesterday, for a series learned day by day), see below.

New behaviour for an entity#

A rare value watch keeps, for each entity (a user, a host, an address, a service), the values it has had, and flags a value it never had before:

  • a new country for a user: entity attr.user.id, value *Country (from the IP address)* (logthread.geo.country_code, filled by Enrichment once it is turned on);
  • a new process on a host: entity res.host.name, value attr.process.name;
  • a new log pattern for a service: entity service, value *Log pattern*.

How it decides:

  • It first learns for 1 to 30 days (default 7): the values each entity already has are read and never flagged. Then each hour of arriving lines is checked once it closes.
  • A value is flagged only for an entity first seen at least 24 hours earlier, so a brand-new user's first country is not news.
  • An entity with more than 100 different values is too varied for "never seen" to mean anything and is not flagged.
  • With linked identities on (the default), values confirmed as the same identity on Segments (a person's user id and e-mail) share one history. A segment can limit the watch to its members (for example administrators).
  • Each finding has a score from 60 to 100: higher when fewer other entities have that value, e.g. "user.id 42: first time with geo.country_code BR (seen with IN, US; 0 of 140 ids have it)".

The preview reads the last 7 days of your own lines: it learns from the first 6 and shows what the last day would have flagged.

Far from its peers#

A population watch counts the lines matching a condition (for example failed logins, attr.event.code:4625) for each entity every hour and compares each one with its peers: the entities with the same value of a group field (for example res.host.group), or every other entity. Peers include those with no matching line that hour (they count as 0).

An entity is flagged when, in one hour, it has at least the minimum lines (default 10), its group has at least the minimum peers (default 5), and it has at least *N* times the group's median (default 10×; a median of 0 counts as 1): "web-7: 140 matching lines in the hour, 14× the median of its group web (10; 32 hosts)". The score is 100 × (1 − 1 / ratio), so 10× scores 90. The preview shows what the last 24 hours would have flagged.

Bots, scrapers and AI agents#

A behaviour watch scores each client of your site or API every hour and flags the ones that behave unlike your usual traffic: a scraper walking through product ids, an AI agent crawling every route, a credential-stuffing script. Nothing leaves your workspace: the model is built from your own request lines and runs inside Logthread.

Set it up from Respond → Alerts → Anomalies → New watch → Bots, scrapers and AI agents:

  • For each client: the IP address (source.address), the user (user.name) or a device id (device.id, a long-lived cookie or app install id from your app). Setup shows how many lines of the last day carry each.
  • Which lines are requests: url.path:* or http.route:* (setup offers the ones your lines have, with their counts, and picks one that has data), or any other condition.
  • At least this many requests in an hour (default 50): quieter clients are not scored.
  • Sensitivity: how unusual a client must be: low (only the most unusual 0.1% of client-hours are even considered, and the score must be at least 70), medium (0.5%, at least 65; the default) or high (1%, at least 60).

For each client and hour it measures nine things: how many requests (rate), the busiest minute against its average minute (burst), distinct paths per request, distinct routes (the path with numbers, UUIDs and hex ids as :id), the most distinct ids on one route it requested at least 20 times (walking through objects), the share of errors (HTTP status 400 and above) and of 401, 403 and 429, how regular the time between requests is, and how unusual its order of routes is against the order your traffic usually follows.

How it decides:

  • It first learns your usual traffic from the last 3 days, hour by hour (usually within the hour), then checks each hour of arriving lines once it closes.
  • Each hour, a model of your usual client-hours (an isolation forest over up to 20,000 of them) scores every client. A client is flagged only when its score is among the most unusual share for the sensitivity, is at least that sensitivity's minimum score, and at least two of the measures are far from your usual traffic the way machines differ: faster, burstier, more regular, walking through more ids, failing or denied more, an unusual order of routes, or the same few paths again and again from a busy client. A client that is just quieter than usual is never flagged. At most 50 clients an hour, the most unusual first.
  • Each finding has a score from 0 to 100 and says what is unusual, in words: "203.0.113.9: walked 300 distinct /api/orders/:id ids in 310 requests (usual about 2), 98% regular timing (usual 10%), unusual page order (6.2 bits a step, usual 1.4)".

The preview scores the last day of your own lines against that day itself, before the watch has learned, and shows what it would have flagged.

Before ingest reaches its limit#

A forecast watch alerts before the workspace reaches its daily ingest limit or its monthly usage alert, not after. The forecast takes what was ingested so far in the day or month, then adds the usual amount for each remaining hour of the week (the median of the last 4 weeks; the busy path adds twice its spread). "Today's ingest reaches the daily ingest cap of 50 GB at about 18:00 UTC (in 5 h), at the usual rate for each hour of the week." Choose how many hours ahead to be told (up to 3 days for the daily ingest cap, 14 days for the monthly usage alert). It needs 3 days of ingest first; a workspace without that kind of limit shows No limit. The same forecast is on Administration → Usage, with a button to set the watch up.

Why is it unusual?#

Every anomaly can be explained from its page:

  • for a series outside its band, the fields whose values differ most between the unusual step and the same hour last week (from What drives this?), and for failed lines or error rate per service, the values more common in failing requests (What's different);
  • for an entity far from its peers, the fields that differ in its matching lines against the same hour last week;
  • for a new value, the values the entity had before, with how many hours and when;
  • for a client flagged by a behaviour watch, its three most unusual measures in words, the fields that differ in its lines, and What's different for that client in that hour.

Each value links to its own page, and the step's lines open in Explore.

Anomalies of one entity#

The page of any value (a user, a host, an address) lists its Anomalies of the last 30 days from every watch, with their scores, counting the values of its identity together.

Limits#

  • 20 anomaly watches per workspace (every kind together), 50 series per watch.
  • A rare-value watch tracks up to 20,000 entities (the least recently seen are dropped first) and reads up to 20,000 entity and value pairs an hour; a busier hour is read in part and the watch says so. A population watch reads every entity of the hour and returns the 500 busiest above the minimum. A behaviour watch scores the 5,000 busiest clients of each hour. Findings are kept 90 days.
  • Log watches see a value only in hours where it is among the field's 100 busiest values (the hourly summaries keep the top 100): watch values that are usually among them.
  • A log watch scores an hour only once its summaries are complete, usually 10 to 15 minutes after the hour ends. A metric watch scores the newest step five minutes after it ends; a series whose point has not arrived is not scored (it never counts as 0) and keeps any open incident.
  • A metric watch with many groups reads its 50 busiest groups only. If part of its history is still too large to read, it keeps its last band and shows Stale.

From an AI assistant (MCP)#

list_anomalies returns the series outside their band now (or every series with all_series: true), each with its value, expected band, score, the sentence above and links, and the latest findings of rare-value, peer and behaviour watches. entity_anomalies lists one entity's anomalies, explain_anomaly explains an unusual step and usage_forecast says when the limits are reached. See MCP.