Text logs in CSV format
CSV logs without header
2020,09,01,10:35:23,SEND,192.168.1.3,"PING"
2020,09,01,10:35:25,RECV,192.168.1.3,"PONG"
2020,09,01,10:35:25,RESTART,-,"System restarts"parser:
csv:
# CSV files come in many flavors and you can choose the delimiter character to split each row
delimiter: ","
# Names in the 'columns' array will be mapped to columns in each row.
# If you want to skip a column, you can set the name at the same index to an empty string ("")
columns:
- year
- month
- day
- time
- action
- ip_address
- message
# CSV files sometimes use placeholder values for missing or N/A data.
# You can define such values with 'emptyValues' and they will be ignored.
emptyValues: ["-"]
# The 'expandFields' directive will render a template string injecting generated fields into the key/value pairs
expandFields:
# Since the timestamp is split across multiple columns, we need to re-assemble it into RFC3339 format
# The following will add a 'timestamp' field by replacing the fields from CSV values
timestamp: '%{year}-%{month}-%{day}T%{time}Z'
fields:
- name: timestamp
type: timestamp
timeFormats:
- rfc3339
isEventTime: true
required: true
- name: action
type: string
required: true
- name: ip_address
type: string
indicators: [ip]
- name: message
type: stringCSV logs with header
Last updated
Was this helpful?

