from.asciidoc 839 B

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