> For the complete documentation index, see [llms.txt](https://docs.bindplane.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bindplane.com/integrations/sources/csv.md).

# CSV

The CSV source tails CSV-formatted log files on the collector host and parses each row into a structured log record. You supply a comma-delimited header that names the columns, and Bindplane maps each value in a row to the matching key.

### Supported Telemetry Types

| Platform | Metrics | Logs | Traces |
| -------- | ------- | ---- | ------ |
| Linux    |         | ✓    |        |
| Windows  |         | ✓    |        |
| macOS    |         | ✓    |        |

### Prerequisites

* A collector installed on the host where the CSV files reside.
* Read access for the collector to the file or directory paths being tailed.
* A header that lists the column names in the same order they appear in the files.

### Configuration

<figure><img src="/files/VrLNpRKMHXXMI1LxByqg" alt="Bindplane docs - CSV - image 1"><figcaption></figcaption></figure>

#### General

| Parameter            | Type    | Default | Description                                                               |
| -------------------- | ------- | ------- | ------------------------------------------------------------------------- |
| Header               | String  |         | A comma-delimited list of keys assigned to each of the columns. Required. |
| File Path(s)         | Strings | `[]`    | File or directory paths to tail for logs. Required.                       |
| Exclude File Path(s) | Strings | `[]`    | File or directory paths to exclude from tailing.                          |
| Log Type             | String  | `csv`   | A friendly name that is added to each log entry as an attribute.          |

#### Advanced

| Parameter | Type    | Default | Description                                                                                                                  |
| --------- | ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- |
| Encoding  | Enum    | `utf-8` | The encoding of the file being read. Valid values: `nop`, `utf-8`, `utf-16le`, `utf-16be`, `ascii`, `big5`.                  |
| Start At  | Enum    | `end`   | Start reading logs from `beginning` or `end` of the file.                                                                    |
| Parse     | Boolean | `true`  | Parses the CSV fields into structured data using the configured header. Set to `false` to keep the raw line without parsing. |

### Example Configuration

#### Standalone Source

```yaml
apiVersion: bindplane.observiq.com/v1
kind: Source
metadata:
  id: csv
  name: csv
spec:
  type: csv
  parameters:
    - name: header
      value: 'timestamp,level,method,path,status'
    - name: file_path
      value:
        - '/var/log/myapp/*.csv'
    - name: log_type
      value: 'myapp'
    - name: start_at
      value: 'end'
    - name: encoding
      value: 'utf-8'
    - name: parse
      value: 'true'
```

### Configuration Tips

#### Matching the header to your files

* List the keys in `header` in the exact order the columns appear in the file. The number of keys should match the number of columns, otherwise rows may parse with missing or shifted values.
* If your files do not include a header row, the `header` parameter still supplies the column names, so the first data row is parsed normally.

#### File paths and read position

* `file_path` accepts both individual files and directory glob patterns (for example, `/var/log/myapp/*.csv`), and multiple entries can be supplied.
* Use `start_at: beginning` to ingest existing file contents on first run. Leave it at `end` to read only new lines appended after the collector starts.
* Use `exclude_file_path` to skip files that would otherwise match a `file_path` glob, such as rotated or archived files.

#### Encoding

* Set `encoding` to match the file's character set. Use `nop` to read bytes without decoding when the file is not text.

### Troubleshooting

**Symptom:** Logs are ingested but the fields are not split into separate attributes. **Solution:** Confirm `parse` is set to `true` and that `header` lists every column. When parsing is disabled or the header is empty, rows are kept as the raw line instead of structured data.

**Symptom:** Column values appear under the wrong keys. **Solution:** Verify the order and count of keys in `header` match the columns in the file. A mismatch shifts values into adjacent fields.

**Symptom:** No logs are collected from existing files. **Solution:** The source defaults to `start_at: end`, which reads only new lines. Set `start_at` to `beginning` to ingest content that already exists in the files, and confirm the collector has read access to the configured paths.

### Related Resources

* [Bindplane sources documentation](https://bindplane.com/docs/resources/sources/csv)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.bindplane.com/integrations/sources/csv.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
