from.asciidoc 822 B

123456789101112131415161718192021222324252627282930313233343536
  1. [[esql-from]]
  2. === `FROM`
  3. The `FROM` source command returns a table with up to 10,000 documents from a
  4. data stream, index, or alias. Each row in the resulting table represents a
  5. document. Each column corresponds to a field, and can be accessed by the name
  6. of that field.
  7. [source,esql]
  8. ----
  9. FROM employees
  10. ----
  11. You can use <<api-date-math-index-names,date math>> to refer to indices, aliases
  12. and data streams. This can be useful for time series data, for example to access
  13. today's index:
  14. [source,esql]
  15. ----
  16. FROM <logs-{now/d}>
  17. ----
  18. Use comma-separated lists or wildcards to query multiple data streams, indices,
  19. or aliases:
  20. [source,esql]
  21. ----
  22. FROM employees-00001,employees-*
  23. ----
  24. Use the `METADATA` directive to enable <<esql-metadata-fields,metadata fields>>:
  25. [source,esql]
  26. ----
  27. FROM employees [METADATA _id]
  28. ----