Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What's the 411? Building Alerts on Elasticsearch at Etsy

Elastic Co
February 18, 2016

What's the 411? Building Alerts on Elasticsearch at Etsy

When working with a web application, you may find yourself drowning in logs. Some of this data is vital for debugging your application, and some can be a rich source of data for alerting. This talk will cover how Etsy constructs and responds to alert queries, as well as offer up ideas for additional types of alerts.

Elastic Co

February 18, 2016
Tweet

More Decks by Elastic Co

Other Decks in Technology

Transcript

  1. Main Elasticsearch cluster •  Types –  Access logs –  Application

    logs –  Error logs •  3,000,000,000 lines/day •  30 day log retention •  211TB data LOG ALL THE THINGS
  2. •  Heavily depend on alerting •  Moved to ES in

    mid 2014 •  We wanted –  Concise query syntax –  Automatic query scheduling •  No good options at the time ALERT ON ALL THE THINGS
  3. Searches: Automatically query a data source and return information Types

    •  Ping –  Check the reachability of a host •  HTTP –  Check the response code of an URL •  Logstash –  Retrieve results from Elasticsearch
  4. Filters: Remove matching Alerts Types •  Regex –  Filter Alerts

    matching a regex •  Dedupe –  Filter Alerts that have been seen recently •  Throttle –  Filter Alerts that occur frequently
  5. Targets: Send Alerts to external services Types •  WebHook – 

    Send Alerts to an HTTP endpoint •  Notification –  Send Alerts to an (extra) email address
  6. Searches Fields •  Query –  The query to execute • 

    Frequency –  How often to schedule the query •  Assignee –  User/Group responsible for these Alerts •  Priority –  How important these Alerts are
  7. Search page •  Manage a search –  Modify –  Delete

    –  Test –  Execute –  Configure Filters/Targets •  View statistics •  Changelog
  8. Alerts: Are actionable events Actions •  Escalation –  Promotes an

    Alert to high priority •  Assignment –  Sets a new Assignee for an Alert •  Resolution –  Marks an Alert as finished
  9. •  Filters Alerts •  Manage Alerts –  Escalate/De-escalate –  Assign

    –  Mark New/In Progress/Resolved –  Add Note Alerts page
  10. Alert page •  Manage Alert –  Escalate/De-escalate –  Assign – 

    Mark New/In Progress/Resolved –  Add Note •  View changelog
  11. Command Syntax Joins *  |  join  source:src_ip  target:dst_ip   Aggregations

    *  |  agg:terms  field:src_ip      |  agg:terms  field:user_id   Transactions *  |  trans  field:request_uuid   Lists src_ip:@internal_ips   Features
  12. Logstash Search page Fields: •  Time Range –  How far

    back to query •  Result Type –  The type of data to return •  Result Filter –  Only return results if the result set matches a condition
  13. Search Ideas •  Spike in HTTP 500 responses •  POSTs

    with a referrer from another site •  Odd HTTP verbs •  Googlebot useragent from non-Google IP •  Requests from known bad IPs •  Sign-ins from unusual locations