dissect.asciidoc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. [discrete]
  2. [[esql-dissect]]
  3. === `DISSECT`
  4. `DISSECT` enables you to <<esql-process-data-with-dissect-and-grok,extract
  5. structured data out of a string>>.
  6. **Syntax**
  7. [source,esql]
  8. ----
  9. DISSECT input "pattern" [APPEND_SEPARATOR="<separator>"]
  10. ----
  11. *Parameters*
  12. `input`::
  13. The column that contains the string you want to structure. If the column has
  14. multiple values, `DISSECT` will process each value.
  15. `pattern`::
  16. A <<esql-dissect-patterns,dissect pattern>>.
  17. `<separator>`::
  18. A string used as the separator between appended values, when using the <<esql-append-modifier,append modifier>>.
  19. *Description*
  20. `DISSECT` enables you to <<esql-process-data-with-dissect-and-grok,extract
  21. structured data out of a string>>. `DISSECT` matches the string against a
  22. delimiter-based pattern, and extracts the specified keys as columns.
  23. Refer to <<esql-process-data-with-dissect>> for the syntax of dissect patterns.
  24. *Examples*
  25. // tag::examples[]
  26. The following example parses a string that contains a timestamp, some text, and
  27. an IP address:
  28. [source.merge.styled,esql]
  29. ----
  30. include::{esql-specs}/docs.csv-spec[tag=basicDissect]
  31. ----
  32. [%header.monospaced.styled,format=dsv,separator=|]
  33. |===
  34. include::{esql-specs}/docs.csv-spec[tag=basicDissect-result]
  35. |===
  36. By default, `DISSECT` outputs keyword string columns. To convert to another
  37. type, use <<esql-type-conversion-functions>>:
  38. [source.merge.styled,esql]
  39. ----
  40. include::{esql-specs}/docs.csv-spec[tag=dissectWithToDatetime]
  41. ----
  42. [%header.monospaced.styled,format=dsv,separator=|]
  43. |===
  44. include::{esql-specs}/docs.csv-spec[tag=dissectWithToDatetime-result]
  45. |===
  46. // end::examples[]