CSV plugin problem


(DD) #1

My sample data is like this and my config file is below. data not converted properly.

input {
file {
path => "/home/node/Copy/SDP/SDP-testdata/sdptestdata.csv"
start_position=> beginning
#sincedb_path => "/dev/null"
}
}

filter {
if [message] =~ /^\s*$/ { drop { } }
if [message] =~ /Press/ { drop {} }
if [message] =~ "-"{mutate {replace => ["message", "float" ]}}
csv {
separator => " "
convert =>

 {

  "SDP.succrate"                                  => "float"
  "SDP.Failrate"                                   => "float"
  "SDP.Rejectrate"                               => "integer"
  "SDP.Retransmission.Detected"   => "integer"
  "SDP.Duplicate.Answered"            => "float"
  "SDP.Throughput.persec"             => "float"
}
columns => ["SDP.Incident.Date","SDP.Attributes.Name","SDP.succrate","SDP.Failrate","SDP.Rejectrate", "SDP.Retransmission.Detected","SDP.Duplicate.Answered", "SDP.Throughput.persec","SDP.RT.Avg","SDP.RT.Min","SDP.RT.Max"]

}

date {
match => [ "SDP.Incident.Date" , "dd-mm-yy HH:mm:ss" ]
}

mutate {convert => ["SDP.RT.Avg", "float"]}
mutate {convert => ["SDP.RT.Min", "float"]}
mutate {convert => ["SDP.RT.Max", "float"]}

}

output {
stdout {codec=>rubydebug}
}


(Magnus B├Ąck) #2

My sample data is like this and my config file is below. data not converted properly.

Please show an example event produced by Logstash (use your stdout {codec=>rubydebug} output) and explain what's wrong about it.


(DD) #3

able to send data to the kibana now the problem is want to convert "-" into 0 . this is kibana output.
![image|690x212](upload://6yYytbRwIjhRkzd4xJZExcm1

Logstash output:


(DD) #4

I managed to solve this problem using gsub filter , now facing another issue adding timestamp .


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.