Export Kibana data to CSV
How Kibana's CSV export works, what it changes about your data, and what to check before sharing the file in a spreadsheet or other tool.
Exporting from Kibana to CSV turns documents or aggregated results in Elasticsearch into a flat, delimited text file that spreadsheets, scripts and other tools can open. It is often the quickest way to hand log or event data to someone who does not use Kibana. The conversion is lossy, though. This review covers what the export changes, when it suits the job, and what can go wrong after the file leaves Kibana.
Is CSV export the right choice?
CSV export is a good fit when the data is already tabular or close to it: a Discover view with a chosen set of columns, or a table-style visualization with a modest number of rows. The main benefit is portability. Almost any spreadsheet, database import tool or scripting language can read the result without knowing anything about Elasticsearch.
The decisive tradeoff is structure. CSV has one row per record and one value per cell. Nested objects, arrays, multi-value fields and field types do not survive intact. If the receiving side needs that structure, or needs to re-import the data into Elasticsearch, a structured format such as JSON or NDJSON is usually the better choice.
- CSV export tends to suit:
- Sharing a filtered set of events with colleagues who work in spreadsheets
- Feeding a one-off report or audit request
- Moving a small or moderate result set into another analysis tool
- Another format or method tends to suit:
- Data with nested or array fields that must stay grouped
- Very large result sets that may hit export size limits
- Round trips back into Elasticsearch, where field types matter
- Recurring automated pipelines, where an API or ingest tool is more dependable than a manual export
Where the export happens in Kibana
Kibana offers CSV output in more than one place, and the options differ by version and, for some reporting features, by license. The paths below are the commonly documented ones. Check the documentation for your exact version before relying on any one of them.
- Discover: the Share menu includes a CSV report option. The export uses the current query, filters, time range and selected columns. Older versions required the search to be saved first.
- Dashboards: panels based on saved searches can usually generate CSV, and table-style visualization panels can often be downloaded as CSV from the panel menu.
- Reporting: generated CSV files are typically listed in the Reporting area of Stack Management, where they can be downloaded once ready.
- Outside the Kibana interface: the Elasticsearch SQL API can return query results as CSV. Scripted export with scroll or point-in-time searches gives more control over very large data sets.
What the export changes
This is a format conversion, not a cosmetic one. The stored characters in the output differ from the source documents. That matters because the file is what the recipient works with, not what Kibana displayed on screen.
| Aspect | In Elasticsearch / Kibana | In the CSV file |
| Records | JSON documents | One text row per document or result row |
| Fields | Typed fields (date, number, keyword, etc.) | Untyped text columns; the receiving tool guesses types |
| Nested objects and arrays | Preserved as structure | Flattened or joined into a single cell value |
| Columns | All fields available | Only the columns selected in the view |
| Value display | Shaped by field formatters | Generally written in formatted form rather than raw stored values; confirm for your version |
| Time range | Can be relative, such as last 24 hours | Fixed to the data matched when the report was generated |
Kibana's Advanced Settings include options for the CSV separator and for whether values are quoted. Changing the separator to a tab produces tab-separated output, which can avoid problems when values commonly contain commas. Reporting also has configuration settings for maximum CSV size and for how formula-like values are handled. Defaults vary by version, so no specific limit is stated here.
Because the export reflects the selected columns, a quick review of the Discover column list before exporting is worthwhile. Fields not shown as columns are generally not included, and a default view that only shows the document summary may not produce the columns you expect.
Will the file stay readable and usable after sharing?
Most problems with Kibana CSV files appear after the export, when another program interprets the text. The file itself may be correct while the spreadsheet's view of it is not.
- Character encoding: some spreadsheet applications misread UTF-8 files without a byte order mark, which garbles accented letters, non-Latin scripts and emoji. Kibana reporting has a setting to add a byte order mark. Importing through the spreadsheet's import dialog with UTF-8 selected is another workaround.
- Delimiter and locale: in regions where the comma is the decimal separator, spreadsheets may expect semicolons. A comma-delimited file can then open as a single column.
- Type guessing: spreadsheets may strip leading zeros from IDs, turn long numeric identifiers into scientific notation and lose precision, or reinterpret date strings. Importing those columns as text avoids this.
- Formula injection: cell values beginning with characters such as an equals sign can run as formulas when the file is opened in a spreadsheet. Log data often contains attacker-controlled strings, so this is a real risk. Kibana has reporting settings for checking or escaping such values. Confirm how they are configured before sharing exports widely.
- Line breaks inside values: multi-line messages, such as stack traces, are valid inside quoted CSV fields, but some simple parsers and command-line tools split them into separate rows.
Editing and searching are generally straightforward once the file opens correctly, because CSV is plain text. Accessibility depends on the application used to open it rather than on the file. No tests of specific screen readers or spreadsheet versions were available for this review, so no claims are made about how a particular assistive technology handles these files.
Privacy and handling
A CSV export copies data out of the access controls that applied inside Kibana and Elasticsearch. Anyone who receives the file can read every value in it. Exports from logs may include IP addresses, user identifiers, tokens or other sensitive fields. Removing unneeded columns before export is the simplest safeguard. Generated reports may also be kept by Kibana for a period. How long depends on your deployment's configuration, and nothing about retention should be assumed from the interface.
A practical checklist before exporting
- Confirm the time range and filters match what the recipient needs.
- Select only the columns required, and check that the ones you need are actually present.
- Decide on a comma or tab separator based on the data and the recipient's locale.
- Check whether formula escaping and byte order mark settings are configured appropriately.
- For large result sets, check the configured CSV size limit and whether the report finished without truncation. If in doubt, use an API-based export.
- Open the result in the recipient's tool, or ask them to, and spot-check IDs, dates and non-ASCII text.
Gaps in this review
No version-specific evidence, size limits, default settings, licensing details or test results were supplied for this review. The behavior described reflects generally documented Kibana features and general CSV handling principles, not measured observations. Menu locations, default limits and license requirements have changed across Kibana releases, so verify them against the documentation for the version you run.