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

Elastic at Paylocity: Analyzing 800GB a day

Elastic Co
September 13, 2017

Elastic at Paylocity: Analyzing 800GB a day

Elastic{ON} Tour Chicago - September 13, 2017

Learn how Paylocity uses Elastic for analysis.

Justin Purdy | Systems Administrator | Paylocity

Elastic Co

September 13, 2017
Tweet

More Decks by Elastic Co

Other Decks in Technology

Transcript

  1. 3 Starting Architecture Beats Log Files Windows Events Firewall Load

    Balancers Nodes (2) Logstash Elasticsearch Kibana X-pack Authentication X-pack AD Instances (2) Master/Data Nodes (4) Version 5.0 across the board 2TB Pure storage per elasticsearch node The worst grok filter ever
  2. 4 For real, it was so bad… grok { match

    => [ "message", "%{TIMESTAMP_ISO8601:log_timestamp} %{URIPATH} %{IP} %{NUMBER:sc-status} %{NUMBER:sc-substatus} %{NUMBER:sc-bytes} %{WORD} %{NOTSPACE} %{IPORHOST} %{NOTSPACE} %{NOTSPACE} %{QS} (?:\"%{DATA}\"|-) %{NOTSPACE} %{NUMBER} %{NUMBER:cs-bytes} (?:\"%{DATA}\"|-) \"%{DATA}\" \"(?<x_forwarded_for>%{IP:xff_clientip}(?:, .*)?)\" %{INT:TimeTakenMS}" ] add_tag => "iislogtype_A“ tag_on_failure => "nottypeA“ } if "nottypeA" in [tags] { grok { match => [ "message", "%{TIMESTAMP_ISO8601:log_timestamp} %{URIPATH} %{IP} %{NUMBER:sc-status} %{NUMBER:sc-substatus} %{NUMBER:sc-bytes} %{WORD} %{NOTSPACE} %{IPORHOST} %{NOTSPACE} %{NOTSPACE} %{QS} (?:\"%{DATA}\"|-) %{NOTSPACE} %{NUMBER} %{NUMBER:cs-bytes} (?:\"%{DATA}\"|-) \"%{DATA}\" - %{INT:TimeTakenMS}" ] add_tag => "iislogtype_A2“ tag_on_failure => "nottypeA2“ } mutate { remove_tag => [ "nottypeA" ] } } if "nottypeA2" in [tags] { grok { match => [ "message", "%{TIMESTAMP_ISO8601:log_timestamp} %{URIPATH} %{IP} %{NUMBER:sc-status} %{NUMBER:sc-substatus} %{NUMBER:sc-bytes} %{WORD} %{NOTSPACE} %{IPORHOST} %{NOTSPACE} %{NOTSPACE} %{QS} (?:\"%{DATA}\"|-) %{NOTSPACE} %{NUMBER} %{NUMBER:cs-bytes} (?:\"%{DATA}\"|-) \"%{DATA}\" %{INT:TimeTakenMS} \"(?<x_forwarded_for>%{IP:xff_clientip}(?:, .*)?)\"" ] add_tag => "iislogtype_B" tag_on_failure => "nottypeB“ } mutate { remove_tag => [ "nottypeA2" ] } } if "nottypeB" in [tags] { grok { match => [ "message", "%{TIMESTAMP_ISO8601:log_timestamp} %{URIPATH} %{IP} %{NUMBER:sc-status} %{NUMBER:sc-substatus} %{NUMBER:sc-bytes} %{WORD} %{NOTSPACE} %{IPORHOST} %{NOTSPACE} %{NOTSPACE} %{QS} (?:\"%{DATA}\"|-) %{NOTSPACE} %{NUMBER} %{NUMBER:cs-bytes} (?:\"%{DATA}\"|-) \"%{DATA}\" %{INT:TimeTakenMS} -" ] add_tag => "iislogtype_B2“ } mutate { remove_tag => [ "nottypeB" ] } }
  3. 5 For real, it was so bad… grok { match

    => [ "message", "%{TIMESTAMP_ISO8601:log_timestamp} %{URIPATH} %{IP} %{NUMBER:sc-status} %{NUMBER:sc-substatus} %{NUMBER:sc-bytes} %{WORD} %{NOTSPACE} %{IPORHOST} %{NOTSPACE} %{NOTSPACE} %{QS} (?:\"%{DATA}\"|-) %{NOTSPACE} %{NUMBER} %{NUMBER:cs-bytes} (?:\"%{DATA}\"|-) \"%{DATA}\" \"(?<x_forwarded_for>%{IP:xff_clientip}(?:, .*)?)\" %{INT:TimeTakenMS}" ] }
  4. 6 For real, it was so bad… grok { match

    => [ "message", "%{TIMESTAMP_ISO8601:log_timestamp} %{URIPATH} %{IP} %{NUMBER:sc- status} %{NUMBER:sc-substatus} %{NUMBER:sc-bytes} %{WORD} %{NOTSPACE} %{IPORHOST} %{NOTSPACE} %{NOTSPACE} %{QS} (?:\"%{DATA}\"|-) %{NOTSPACE} %{NUMBER} %{NUMBER:cs-bytes} (?:\"%{DATA}\"|-) \"%{DATA}\" \"(?<x_forwarded_for>%{IP:xff_clientip}(?:, .*)?)\" %{INT:TimeTakenMS}" ] add_tag => "iislogtype_A“ tag_on_failure => "nottypeA“ } if "nottypeA" in [tags] { grok { match => [ "message", "%{TIMESTAMP_ISO8601:log_timestamp} %{URIPATH} %{IP} %{NUMBER:sc-status} %{NUMBER:sc-substatus} %{NUMBER:sc-bytes} %{WORD} %{NOTSPACE} %{IPORHOST} %{NOTSPACE} %{NOTSPACE} %{QS} (?:\"%{DATA}\"|-) %{NOTSPACE} %{NUMBER} %{NUMBER:cs-bytes} (?:\"%{DATA}\"|-) \"%{DATA}\" - %{INT:TimeTakenMS}" ] add_tag => "iislogtype_B“ tag_on_failure => "nottypeB“ } mutate { remove_tag => [ "nottypeA" ] }
  5. 7 For real, it was so bad… grok { match

    => [ "message", "%{TIMESTAMP_ISO8601:log_timestamp} %{URIPATH} %{IP} %{NUMBER:sc-status} %{NUMBER:sc-substatus} %{NUMBER:sc-bytes} %{WORD} %{NOTSPACE} %{IPORHOST} %{NOTSPACE} %{NOTSPACE} %{QS} (?:\"%{DATA}\"|-) %{NOTSPACE} %{NUMBER} %{NUMBER:cs-bytes} (?:\"%{DATA}\"|-) \"%{DATA}\" \"(?<x_forwarded_for>%{IP:xff_clientip}(?:, .*)?)\" %{INT:TimeTakenMS}" ] add_tag => "iislogtype_A“ tag_on_failure => "nottypeA“ } if "nottypeA" in [tags] { grok { match => [ "message", "%{TIMESTAMP_ISO8601:log_timestamp} %{URIPATH} %{IP} %{NUMBER:sc-status} %{NUMBER:sc-substatus} %{NUMBER:sc-bytes} %{WORD} %{NOTSPACE} %{IPORHOST} %{NOTSPACE} %{NOTSPACE} %{QS} (?:\"%{DATA}\"|-) %{NOTSPACE} %{NUMBER} %{NUMBER:cs-bytes} (?:\"%{DATA}\"|-) \"%{DATA}\" - %{INT:TimeTakenMS}" ] add_tag => "iislogtype_A2“ tag_on_failure => "nottypeA2“ } mutate { remove_tag => [ "nottypeA" ] } } if "nottypeA2" in [tags] { grok { match => [ "message", "%{TIMESTAMP_ISO8601:log_timestamp} %{URIPATH} %{IP} %{NUMBER:sc-status} %{NUMBER:sc-substatus} %{NUMBER:sc-bytes} %{WORD} %{NOTSPACE} %{IPORHOST} %{NOTSPACE} %{NOTSPACE} %{QS} (?:\"%{DATA}\"|-) %{NOTSPACE} %{NUMBER} %{NUMBER:cs-bytes} (?:\"%{DATA}\"|-) \"%{DATA}\" %{INT:TimeTakenMS} \"(?<x_forwarded_for>%{IP:xff_clientip}(?:, .*)?)\"" ] add_tag => "iislogtype_B" tag_on_failure => "nottypeB“ } mutate { remove_tag => [ "nottypeA2" ] } } if "nottypeB" in [tags] { grok { match => [ "message", "%{TIMESTAMP_ISO8601:log_timestamp} %{URIPATH} %{IP} %{NUMBER:sc-status} %{NUMBER:sc-substatus} %{NUMBER:sc-bytes} %{WORD} %{NOTSPACE} %{IPORHOST} %{NOTSPACE} %{NOTSPACE} %{QS} (?:\"%{DATA}\"|-) %{NOTSPACE} %{NUMBER} %{NUMBER:cs-bytes} (?:\"%{DATA}\"|-) \"%{DATA}\" %{INT:TimeTakenMS} -" ] add_tag => "iislogtype_B2“ } mutate { remove_tag => [ "nottypeB" ] } }
  6. 10 Not as pretty, but just as elegant grok {

    match => [ "message", "%{TIMESTAMP_ISO8601:log_timestamp} %{URIPATH} %{IP} %{NUMBER:sc-status} %{NUMBER:sc-substatus} %{NUMBER:sc-bytes} %{WORD} %{NOTSPACE} %{IPORHOST} %{NOTSPACE} %{NOTSPACE} %{QS} (?:\"%{DATA}\"|-) %{NOTSPACE} %{NUMBER} %{NUMBER:cs-bytes} (?:\"%{DATA}\"|-) \"%{DATA}\" %{INT:time_taken|-|\"(?<x_forwarded_for>%{HOSTNAME:xff_clientip}(?:, .*)?|-)(:%{INT}|)\"} %{INT:time_taken|-|\"(?<x_forwarded_for>%{HOSTNAME:xff_clientip}(?:, .*)?|-)(:%{INT}|)\"}$" ] add_tag => “grokked“ }
  7. 12 “Upgraded” Architecture Diagram Beats Log Files Metrics Windows Events

    Firewall Load Balancers Elasticsearch X-pack Master/Data Nodes (8) Kibana X-pack Instances (2) Nodes (2) Logstash Authentication AD MOAR NODES Bumped each ES node up to 4TB, then 6TB Balanced index sizes
  8. 13 Actually Upgraded Architecture Diagram Elasticsearch Kibana X-pack Authentication Notification

    X-pack AD Instances (2) Master Nodes (3) Coordinating Nodes (3) Data Nodes (10) Beats Log Files Metrics Windows Events Firewall Load Balancers Nodes (2) Logstash Heartbeats X-pack Cloud Monitoring Chad came to visit Dedicated roles Still more nodes
  9. 14 Current Architecture Diagram Elasticsearch Kibana X-pack Authentication Notification X-pack

    AD Instances (2) Master Nodes (3) Coordinating Nodes (3) Data Nodes (10) Beats Log Files Metrics Windows Events Firewall Load Balancers Nodes (2) Logstash Heartbeats X-pack Cloud Monitoring Nodes (3) Production Non-production Master Nodes (3) Data Nodes (8) Production Non-production Instances (1) Production Non-production A place to test TLS all the things Cross-cluster search
  10. 22 Future Architecture Kafka Messaging Queue Kibana X-pack Instances (3)

    Firewall Load Balancers Beats Log Files Metrics Windows Events Heartbeats Nodes (3) Logstash X-pack Elasticsearch X-pack Master Nodes (3) Coordinating Nodes (3) Data Nodes (12) Authentication Notification AD Cloud Monitoring Database Redis, SQL Kafka replays More storage, of course
  11. 25 I enjoy the added flexibility the Elastic Stack has

    provided our team's efforts. It's allowed us to stretch our reach into new data investigation territory and snap back on adversaries in a shorter period of time. - Abe Miller, InfoSec
  12. 26 It's like Elastic is a modern engine, where before

    we were driving like the Flintstones. - Alex Hooker, InfoSec
  13. 27 "The Elastic Stack has armed our teams with the

    powerful tools and insights to combat previously undetected enemies hidden within our codebase. In short: we can slay dragons now. - Joe Stetzer, Dev Lead
  14. 28 Elastic has become the de facto standard for application

    troubleshooting among our dev teams. - Justin Ivins, Director of Internal Tech Operations