community-id.asciidoc 3.0 KB

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