Hello,
I have a plugin that gets data from SQL server and aggregates some records with a unique ID, But unfortaintly I didn't get any output.
My config file is as bellow.
input {
jdbc {
jdbc_connection_string => "my connection String"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_user => "XXX"
statement => "select partID, featureName, name FROM dbo.Parametric WHERE partid =16942660 or partid = 7406888 ORDER BY PartID"
}
}
filter {
aggregate {
task_id => "%{partID}"
code => "
map['featureNames'] ||= []
map['featureNames']<<{ 'featureName' => event.get('featureName') , 'name' => event.get('name')} "
push_map_as_event_on_timeout => true
timeout_tags => ['aggregate']
}
if "featureNames" not in [tags] {
drop {}
}
}
output {
stdout {
codec => rubydebug
}
}
When run It with " bin\logstash -f myconfig.conf -w 1" Logstash runs successfully but no output.
If I removed if
"featureNames" not in [tags] {
drop {}
}
I get the output without any aggregates like this
{
"featurename" => "Failure Rate",
"@version" => "1",
"partid" => 7406888,
"name" => "N/A",
"@timestamp" => 2019-10-29T09:01:51.654Z
}
{
"featurename" => "Minimum Operating Temperature
"@version" => "1",
"partid" => 7406888,
"name" => "-55°C",
"@timestamp" => 2019-10-29T09:01:51.654Z
}
{
"featurename" => "Features",
"@version" => "1",
"partid" => 7406888,
"name" => "High Reliability",
"@timestamp" => 2019-10-29T09:01:51.656Z
}
{
"featurename" => "Type",
"@version" => "1",
"partid" => 7406888,
"name" => "Molded",
"@timestamp" => 2019-10-29T09:01:51.724Z
}
{
"featurename" => "Maximum Operating Temperature
"@version" => "1",
"partid" => 7406888,
"name" => "125°C",
"@timestamp" => 2019-10-29T09:01:51.725Z
}
{
"featurename" => "Lifetime @ Temp.",
"@version" => "1",
"partid" => 7406888,
"name" => "N/A",
"@timestamp" => 2019-10-29T09:01:51.726Z
}
{
"featurename" => "CCC/CQC",
"@version" => "1",
"partid" => 16942660,
"name" => "No",
"@timestamp" => 2019-10-29T09:01:51.727Z
}
{
"featurename" => "Contact Finish",
"@version" => "1",
"partid" => 16942660,
"name" => "Tin",
"@timestamp" => 2019-10-29T09:01:51.727Z
}
{
"featurename" => "Wire Gauge",
"@version" => "1",
"partid" => 16942660,
"name" => "24 AWG",
"@timestamp" => 2019-10-29T09:01:51.728Z
}
{
"featurename" => "Contact Finish Thickness",
"@version" => "1",
"partid" => 16942660,
"name" => "2.54µm",
"@timestamp" => 2019-10-29T09:01:51.728Z
}
{
"featurename" => "Contact End",
"@version" => "1",
"partid" => 16942660,
"name" => "Socket to Socket",
"@timestamp" => 2019-10-29T09:01:51.731Z
}
{
"featurename" => "Length",
"@version" => "1",
"partid" => 16942660,
"name" => "254mm",
"@timestamp" => 2019-10-29T09:01:51.731Z
}
Can anyone tell me what's wrong with my configration ?