populations.asciidoc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. [role="xpack"]
  2. [[ml-configuring-pop]]
  3. === Performing population analysis
  4. Entities or events in your data can be considered anomalous when:
  5. * Their behavior changes over time, relative to their own previous behavior, or
  6. * Their behavior is different than other entities in a specified population.
  7. The latter method of detecting outliers is known as _population analysis_. The
  8. {ml} analytics build a profile of what a "typical" user, machine, or other entity
  9. does over a specified time period and then identify when one is behaving
  10. abnormally compared to the population.
  11. This type of analysis is most useful when the behavior of the population as a
  12. whole is mostly homogeneous and you want to identify outliers. In general,
  13. population analysis is not useful when members of the population inherently
  14. have vastly different behavior. You can, however, segment your data into groups
  15. that behave similarly and run these as separate jobs. For example, you can use a
  16. query filter in the {dfeed} to segment your data or you can use the
  17. `partition_field_name` to split the analysis for the different groups.
  18. Population analysis scales well and has a lower resource footprint than
  19. individual analysis of each series. For example, you can analyze populations
  20. of hundreds of thousands or millions of entities.
  21. To specify the population, use the `over_field_name` property. For example:
  22. [source,js]
  23. ----------------------------------
  24. PUT _ml/anomaly_detectors/population
  25. {
  26. "description" : "Population analysis",
  27. "analysis_config" : {
  28. "bucket_span":"15m",
  29. "influencers": [
  30. "clientip"
  31. ],
  32. "detectors": [
  33. {
  34. "function": "mean",
  35. "field_name": "bytes",
  36. "over_field_name": "clientip" <1>
  37. }
  38. ]
  39. },
  40. "data_description" : {
  41. "time_field":"timestamp",
  42. "time_format": "epoch_ms"
  43. }
  44. }
  45. ----------------------------------
  46. //CONSOLE
  47. // TEST[skip:needs-licence]
  48. <1> This `over_field_name` property indicates that the metrics for each client (
  49. as identified by their IP address) are analyzed relative to other clients
  50. in each bucket.
  51. If your data is stored in {es}, you can use the population job wizard in {kib}
  52. to create a job with these same properties. For example, if you add the sample
  53. web logs in {kib}, you can use the following job settings in the population job
  54. wizard:
  55. [role="screenshot"]
  56. image::images/ml-population-job.jpg["Job settings in the population job wizard]
  57. After you open the job and start the {dfeed} or supply data to the job, you can
  58. view the results in {kib}. For example, you can view the results in the
  59. **Anomaly Explorer**:
  60. [role="screenshot"]
  61. image::images/ml-population-results.jpg["Population analysis results in the Anomaly Explorer"]
  62. As in this case, the results are often quite sparse. There might be just a few
  63. data points for the selected time period. Population analysis is particularly
  64. useful when you have many entities and the data for specific entitles is sporadic
  65. or sparse.
  66. If you click on a section in the timeline or swimlanes, you can see more
  67. details about the anomalies:
  68. [role="screenshot"]
  69. image::images/ml-population-anomaly.jpg["Anomaly details for a specific user"]
  70. In this example, the client IP address `29.64.62.83` received a high volume of
  71. bytes on the date and time shown. This event is anomalous because the mean is
  72. three times higher than the expected behavior of the population.