Hi all,
I'm just getting into using elastic services and as a proof of concept am trying to get csv data from two files that will have two different sets of headers to kibana. The data gets there just fine but I have not header information. If I take the configuration below and remove the else if portion so that I'm only getting one csv file (the get_pods.csv if it matters) then I can get the information in Kibana and I have header fields to work with. I've tried various things I've found online with no luck. Only thing I havent tried is putting the csv's in different directories. Can anyone tell me what they see that is wrong here? Also I'm assuming the problem is logstash conf because of the behavior above but possible something I need to adjust in kibana as well....
Thanks in advance
Logstash.conf:
input {
beats {
port => 5044
}
}
filter {
if [path] == "/Users/me/CodeBase/healthcheck/dev_getPods.csv" {
csv {
columns => [
"DATE",
"ENV",
"NAME",
"READY",
"STATUS",
"RESTARTS",
"AGE"
]
separator => ","
}
} else if [path] == "/Users/me/CodeBase/healthcheck/dev_identity_properties.csv" {
csv {
columns => [
"DATE",
"PROPERTY",
"VALUE",
"LAST_CHANGE",
"PROPERTY",
"OLD_VALUE"
]
separator => ","
}
}
}
output {
elasticsearch {
hosts => "elasticsearch:9200"
}
}
As requested, I've added the rubydebug and some sample output. I've swapper out some of the identifying info for something generic just fyi.
Logstash.conf:
input {
beats {
port => 5044
}
}
filter {
if [path] == "/Users/me/CodeBase/healthcheck/dev_getPods.csv" {
csv {
columns => ["DATE","ENV","NAME","READY","STATUS","RESTARTS","AGE"]
separator => ","
}
} else if [path] == "/Users/me/CodeBase/healthcheck/dev_identity_properties.csv" {
csv {
columns => ["DATE","PROPERTY","VALUE","LAST_CHANGE","PROPERTY","OLD_VALUE"]
separator => ","
}
}
}
output {
stdout { codec => rubydebug }
elasticsearch { hosts => "elasticsearch:9200"}
}
Sample output:
logstash_1 | {
logstash_1 | "@timestamp" => 2019-05-16T21:26:22.437Z,
logstash_1 | "input" => {
logstash_1 | "type" => "log"
logstash_1 | },
logstash_1 | "tags" => [
logstash_1 | [0] "beats_input_codec_plain_applied"
logstash_1 | ],
logstash_1 | "prospector" => {
logstash_1 | "type" => "log"
logstash_1 | },
logstash_1 | "message" => "2019-05-16-15:26:13,dev,inventory-develop-659b9759f-gpppm,2/2,Running,0,4d",
logstash_1 | "fields" => {
logstash_1 | "collection" => "dev_getPods"
logstash_1 | },
logstash_1 | "log" => {
logstash_1 | "file" => {
logstash_1 | "path" => "/Users/me/CodeBase/healthcheck/dev_getPods.csv"
logstash_1 | }
logstash_1 | },
logstash_1 | "host" => {
logstash_1 | "id" => "someId",
logstash_1 | "name" => "someName",
logstash_1 | "architecture" => "x86_64",
logstash_1 | "os" => {
logstash_1 | "name" => "Mac OS X",
logstash_1 | "platform" => "darwin",
logstash_1 | "build" => "17G2208",
logstash_1 | "family" => "darwin",
logstash_1 | "version" => "10.13.6"
logstash_1 | }
logstash_1 | },
logstash_1 | "source" => "/Users/me/CodeBase/healthcheck/dev_getPods.csv",
logstash_1 | "beat" => {
logstash_1 | "name" => "someName",
logstash_1 | "hostname" => "someHostName",
logstash_1 | "version" => "6.7.0"
logstash_1 | },
logstash_1 | "offset" => 4811,
logstash_1 | "@version" => "1"
logstash_1 | }
The data does make it to Kibana just no header fields.