Hi all
I am trying to import a JSON file but I get the following error.
filter {
json {
# This setting must be a string
# Expected string, got ["followUpDate", "dateOfBirth", "medical.dateFinalised", "medical.dateOfEntry", "medical.dateOfSuspension", "medical.dateOfWithdrawal", "medical.gapDateFinalised", "medical.gapDateOfEntry", "medical.gapDateOfSuspension", "medical.gapDateOfWithdrawal", "medical.loyaltyDateFinalised", "medical.loyaltyDateOfEntry", "medical.loyaltyDateOfSuspension", "medical.loyaltyDateOfWithdrawal", "medical.loyalty", "medical.loyaltyStatus", "medical.monthlyTotalContribution", "medical.monthlyRiskContribution", "medical.monthlyMSAContribution", "medical.monthlyLoyaltyContribution", "medical.monthlyOtherContribution", "medical.totalYearToDate", "medical.mostRecentBillDate", "medical.chronic", "medical.msaPayoutChoice", "medical.msaCarryOver", "medical.msaAnnual", "medical.msaProrated", "medical.msaBalance", "medical.annualThreshold", "medical.thresholdProrated", "medical.msaSpent", "medical.amountAccumulatedToThreshold", "medical.currentSPG", "medical.thresholdIndicator", "medical.ihPaid", "medical.lastUpdated", "medical.status", "title", "firstname", "surname", "idNumber", "gender", "employerName", "employer.value", "employer.label", "employer.type_of", "employer.employerNumber", "employer_id", "employerBranch", "occupation", "email", "cellphone", "salary", "status", "initials", "fsp_id", "consultant_id", "type_of", "broker.name", "broker.houseName", "broker.houseCode", "broker.code", "dates.dateOfEntry", "dates.dateOfWithdrawal", "updateSource", "history.0.creator.label", "history.0.creator.value", "history.0.type", "history.0.from", "history.0.to", "history.0.data", "history.0.source", "history.0.timestamp", "currentScheme", "employerNumber", "employerBranchNumber", "memberNumber", "employeeNumber", "language", "numDependants", "numSpouses", "numAdults", "numChildren", "currentOption", "workTelCode", "workTelNumber", "postalAddress1", "postalAddress2", "postalAddress3", "postalSuburb", "postalPostCode", "deleted_at"]
source => ["followUpDate", "dateOfBirth", "medical.dateFinalised", "medical.dateOfEntry", "medical.dateOfSuspension", "medical.dateOfWithdrawal", "medical.gapDateFinalised", "medical.gapDateOfEntry", "medical.gapDateOfSuspension", "medical.gapDateOfWithdrawal", "medical.loyaltyDateFinalised", "medical.loyaltyDateOfEntry", "medical.loyaltyDateOfSuspension", "medical.loyaltyDateOfWithdrawal", "medical.loyalty", "medical.loyaltyStatus", "medical.monthlyTotalContribution", "medical.monthlyRiskContribution", "medical.monthlyMSAContribution", "medical.monthlyLoyaltyContribution", "medical.monthlyOtherContribution", "medical.totalYearToDate", "medical.mostRecentBillDate", "medical.chronic", "medical.msaPayoutChoice", "medical.msaCarryOver", "medical.msaAnnual", "medical.msaProrated", "medical.msaBalance", "medical.annualThreshold", "medical.thresholdProrated", "medical.msaSpent", "medical.amountAccumulatedToThreshold", "medical.currentSPG", "medical.thresholdIndicator", "medical.ihPaid", "medical.lastUpdated", "medical.status", "title", "firstname", "surname", "idNumber", "gender", "employerName", "employer.value", "employer.label", "employer.type_of"]
...
}
}
[ERROR] 2018-06-25 09:48:01.205 [LogStash::Runner] agent - Cannot create pipeline {:reason=>"Something is wrong with your configuration."}
My logstash config file is the following:
input {
file {
path => "/home/uadmin/Healthcare/nmgmem.json"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
json{
source => [ "followUpDate", "dateOfBirth", "medical.dateFinalised", "medical.dateOfEntry", "medical.dateOfSuspension", "medical.dateOfWithdrawal",
"medical.gapDateFinalised", "medical.gapDateOfEntry", "medical.gapDateOfSuspension", "medical.gapDateOfWithdrawal", "medical.loyaltyDateFinalised",
"medical.loyaltyDateOfEntry", "medical.loyaltyDateOfSuspension", "medical.loyaltyDateOfWithdrawal", "medical.loyalty", "medical.loyaltyStatus",
"medical.monthlyTotalContribution", "medical.monthlyRiskContribution", "medical.monthlyMSAContribution", "medical.monthlyLoyaltyContribution",
"medical.monthlyOtherContribution", "medical.totalYearToDate", "medical.mostRecentBillDate", "medical.chronic", "medical.msaPayoutChoice",
"medical.msaCarryOver", "medical.msaAnnual", "medical.msaProrated", "medical.msaBalance", "medical.annualThreshold", "medical.thresholdProrated",
"medical.msaSpent", "medical.amountAccumulatedToThreshold", "medical.currentSPG", "medical.thresholdIndicator", "medical.ihPaid",
"medical.lastUpdated", "medical.status", "title","firstname","surname", "idNumber", "gender", "employerName", "employer.value",
"employer.label", "employer.type_of"]
}
}
output {
elasticsearch {
hosts => "localhost"
index => "nmg-jsontest"
document_type => "test"
}
stdout{}
}