I am trying to use the Split filter in Logstash to separate my Json data into separate documents in elastic. I have used this same Split filter in another case and did not have this problem. I have tried targeting a few different fields and get the same error message. Please let me know if I can clarify anything posted as this is my FIRST forum post. Thanks for taking the time to read.
Here is the Error message I'm getting in Logstash.
Error: [2022-05-04T07:18:01,115][WARN ][logstash.filters.split ][main][f8424efe02fef8508f1f30680490ad8a3d9a978ef5ebc0301f9217ded02aec62] Only String and Array types are splittable. field:Dispatch is of type = NilClass
Logstash Config:
http_poller{
urls =>{
test2 => {
method => get
user => "Username"
password => "XXXX"
url => "https://360test.test.net/360API/director.php/360API/360data/V1/Dispatch?modifier=TestMobile"
type => "json"
codec => "json"
headers => {
Accept => "application/json"
"Content-Type" => "application/json"
}
}
}
request_timeout => 60
schedule => { cron => "*/1 * * * * UTC" }
}
}
filter {
split {
field => "Dispatch"
}
}
output{
elasticsearch {
hosts => ["https://CLOUD END POINT"]
index => "360_data"
user => "User"
password => "XXXX"
}
stdout { codec => rubydebug }
}
Return:
{
"package" => {
"serviceresponse" => [
[0] {
"credentials" => {
"sessiontoken" => "N/A"
},
"data" => {
"Dispatch" => [
[ 0] {
"Company" => "Bethel Company",
"Priority" => "5.00",
"CallNo" => "608357",
"CustomerNo" => "BETHELPO01",
"StatusCode" => "TOSCHEDULE ",
"SiteName" => "Bethel Company",
"href" => "https://360test.test.net/360API/director.php/Dispatch/24143858 ",
"CloseDate" => nil,
"Date" => "2022-05-01 00:00:00.000",
"SiteNo" => "4229719 ",
"DispatchNo" => "24143858 "
},
[ 1] {
"Company" => "Boston Company ",
"Priority" => "4.00",
"CallNo" => "608440",
"CustomerNo" => "BOSTONLA01",
"StatusCode" => "TOSCHEDULE ",
"SiteName" => "Boston Company ",
"href" => "https://360test.test.net/360API/director.php/Dispatch/24350276 ",
"CloseDate" => nil,
"Date" => "2022-05-01 00:00:00.000",
"SiteNo" => "4229754 ",
"DispatchNo" => "24350276 "
},
[ 2] {
"Company" => "Boston Company ",
"Priority" => "5.00",
"CallNo" => "608424",
"CustomerNo" => "BOSTONPS01",
"StatusCode" => "OPEN ",
"SiteName" => "Boston Company ",
"href" => "https://360test.test.net/360API/director.php/Dispatch/24277622 ",
"CloseDate" => nil,
"Date" => "2022-04-30 00:00:00.000",
"SiteNo" => "4229762 ",
"DispatchNo" => "24277622 "
},
[ 3] {
"Company" => "Bourne;City ",
"Priority" => "4.00",
"CallNo" => "608439",
"CustomerNo" => "BOURNE;T01",
"StatusCode" => "TOSCHEDULE ",
"SiteName" => "Bourne City",
"href" => "https://360test.test.net/360API/director.php/Dispatch/24350269 ",
"CloseDate" => nil,
"Date" => "2022-05-01 00:00:00.000",
"SiteNo" => "4229209 ",
"DispatchNo" => "24350269 "
},
],
"Status" => {
"UserVariable" => "Success",
"nError" => 0,
"ErrorMessage" => "No Error",
"Message" => 0,
"TTL" => "0"
}
},
"service" => "360data",
"appname" => "360API",
"method" => "List",
"modifier" => "TestMobile",
"version" => "1",
"dataprovider" => "DEFAULT",
"object" => "Dispatch",
"sid" => "477226"
}
]
},
"@version" => "1",
"@timestamp" => 2022-05-04T14:19:00.682Z,
"tags" => [
[0] "_split_type_failure"
]
}