community-id.asciidoc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[community-id-processor]]
  4. === Community ID processor
  5. ++++
  6. <titleabbrev>Community ID</titleabbrev>
  7. ++++
  8. Computes the Community ID for network flow data as defined in the
  9. https://github.com/corelight/community-id-spec[Community ID Specification].
  10. You can use a community ID to correlate network events related to a single
  11. flow.
  12. The community ID processor reads network flow data from related
  13. {ecs-ref}[Elastic Common Schema (ECS)] fields by default. If you use the ECS, no
  14. configuration is required.
  15. [[community-id-options]]
  16. .Community ID Options
  17. [options="header"]
  18. |======
  19. | Name | Required | Default | Description
  20. | `source_ip` | no | `source.ip` | Field containing the source IP address.
  21. | `source_port` | no | `source.port` | Field containing the source port.
  22. | `destination_ip` | no | `destination.ip` | Field containing the destination IP address.
  23. | `destination_port` | no | `destination.port` | Field containing the destination port.
  24. | `iana_number` | no | `network.iana_number` | Field containing the IANA number.
  25. | `icmp_type` | no | `icmp.type` | Field containing the ICMP type.
  26. | `icmp_code` | no | `icmp.code` | Field containing the ICMP code.
  27. | `transport` | no | `network.transport` | Field containing the transport protocol.
  28. Used only when the `iana_number` field is not present.
  29. | `target_field` | no | `network.community_id` | Output field for the community ID.
  30. | `seed` | no | `0` | Seed for the community ID hash. Must be between
  31. 0 and 65535 (inclusive). The seed can prevent hash collisions between network domains, such as
  32. a staging and production network that use the same addressing scheme.
  33. | `ignore_missing` | no | `true` | If `true` and any required fields are missing,
  34. the processor quietly exits without modifying the document.
  35. include::common-options.asciidoc[]
  36. |======
  37. Here is an example definition of the community ID processor:
  38. [source,js]
  39. --------------------------------------------------
  40. {
  41. "description" : "...",
  42. "processors" : [
  43. {
  44. "community_id": {
  45. }
  46. }
  47. ]
  48. }
  49. --------------------------------------------------
  50. // NOTCONSOLE
  51. When the above processor executes on the following document:
  52. [source,js]
  53. --------------------------------------------------
  54. {
  55. "_source": {
  56. "source": {
  57. "ip": "123.124.125.126",
  58. "port": 12345
  59. },
  60. "destination": {
  61. "ip": "55.56.57.58",
  62. "port": 80
  63. },
  64. "network": {
  65. "transport": "TCP"
  66. }
  67. }
  68. }
  69. --------------------------------------------------
  70. // NOTCONSOLE
  71. It produces this result:
  72. [source,js]
  73. --------------------------------------------------
  74. "_source" : {
  75. "destination" : {
  76. "port" : 80,
  77. "ip" : "55.56.57.58"
  78. },
  79. "source" : {
  80. "port" : 12345,
  81. "ip" : "123.124.125.126"
  82. },
  83. "network" : {
  84. "community_id" : "1:9qr9Z1LViXcNwtLVOHZ3CL8MlyM=",
  85. "transport" : "TCP"
  86. }
  87. }
  88. --------------------------------------------------
  89. // NOTCONSOLE