input {
mongodb {
uri => 'mongodb://caitc:k123%21@1527017/ml4p?authSource=ml4p&readPreference=primary&ssl=false'
placeholder_db_dir => '/Users/caitlyncarlisle/desktop/logstash-7.12.0/bin'
placeholder_db_name => 'logstash_sqlite.db'
collection => 'articles-2012-1'
batch_size => 5000
}
}
filter {
mutate {
copy => { "_id" => "[@metadata][_id]"}
}
mutate{
remove_field => ["_id"]
}
mutate{
remove_field => ["image_url"]
}
mutate{
remove_field => ["maintext"]
}
mutate {
convert => { "civic1_event_type" => "string" }
}
mutate {
convert => { "RAI_event_type" => "string" }
}
mutate {
add_field => {
"location" => ["%{[location_lat]}","%{[location_lon]}"]
}
}
}
output {
stdout {
codec => rubydebug
}
elasticsearch {
action => "index"
index => "mongo_log_data"
hosts => ["localhost:9200"]
}
}
And here is an example:
{
"civic1_model_outputs_legalaction" => 10.96875,
"RAI_event_type" => "-999",
"RAI_model_outputs_security_cooperation" => 3.552734375,
"language" => "en",
"title_rss" => "NULL",
"civic1_model_outputs_arrest" => -1.2744140625,
"civic1_model_outputs_defamationcase" => -0.0156707763671875,
"date_modify" => "2021-02-10T06:36:39Z",
"date_publish" => "2012-11-15T21:37:48Z",
"civic1_event_type" => "legalaction",
"RAI_model_outputs_bribery_economic_corruption" => 2.123046875,
"civic1_model_outputs_mobilizesecurity" => -0.312255859375,
"language_translated" => "en",
"maintext_translated" => "Secretary of State Hillary Clinton ion.\n(AFP)\nDaily newsletterReceive essential international news every morning Subscribe",
"civic1_model_outputs_censor" => -0.237060546875,
"civic1_model_outputs_violencelethal" => -0.07086181640625,
"civic1_model_outputs_changepower" => -0.67138671875,
"RAI_model_outputs_diplomatic_visit" => 1.37890625,
"RAI_model_outputs_surveillance" => -0.447265625,
"RAI_model_outputs_economic_aid_assistance" => -0.55908203125,
"RAI_model_outputs_joint_security_force_exercise" => 0.07330322265625,
"host" => "Caitlyns-MBP.lan",
"RAI_model_outputs_trade_agreement_exchange" => -2.58984375,
"url" => "https://www.france24.com/en/20121115-clinton-testify-benghazi-attack-republicans",
"RAI_model_outputs_intelligence_counterintelligence" => 3.244140625,
"RAI_model_outputs_social_academic_cultural_activity" => -0.02435302734375,
"RAI_model_outputs_media_campaign_intervention" => 0.056610107421875,
"RAI_model_outputs_trade_financial_sanction" => -1.279296875,
"RAI_model_outputs_diaspora_activation" => 0.1064453125,
"log_entry" => "{\"_id\"=>BSON::ObjectId('60237ef801e920023bd60068'), \"authors\"=>[\"News Wires\"], \"date_download\"=>2021-02-10 06:36:39 UTC, \"date_modify\"=>2021-02-10 06:36:39 UTC, \"date_publish\"=>2012-11-15 21:37:48 UTC, \"description\"=>\"Secretary of State Hillary Clinton agreed to testify in hearings on the September attack on the US mission in Benghazi, Libya on Thursday, as Republicans continued to fuel a feud over the handling of…\", \"filename\"=>\"en_20121115-clinton-testify-benghazi-attack-republicans_1612938999.html\", \"image_url\"=>\"https://s.france24.com/media/display/1eb82d40-09e0-11e9-ac2f-005056bff430/w:1280/p:16x9/clinton_24.jpg\", \"language\"=>\"en\", \"title\"=>\"Clinton to testify in Benghazi attack probe\", \"title_page\"=>\"Clinton to testify in Benghazi attack probe\", \"title_rss\"=>\"NULL\", \"source_domain\"=>\"france24.com\", \"maintext\"=>\"Secretary of State Hillary Clinton Subscribe\", \"url\"=>\"https://www.france24.com/en/20121115-clinton-testify-benghazi-attack-republicans\", \"event_extracted\"=>0, \"include\"=>true, \"language_translated\"=>\"en\", \"maintext_translated\"=>\"Secretary of State Hillary Clinton ...\", \"title_translated\"=>\"Clinton to testify in Benghazi attack probe\", \"mordecai_locations\"=>{\"LBY\"=>[\"Benghazi\", \"Libya\"]}, \"civic1\"=>{\"event_type\"=>\"legalaction\", \"model_outputs\"=>{\"arrest\"=>-1.2744140625, \"censor\"=>-0.237060546875, \"changeelection\"=>-0.303466796875, \"changepower\"=>-0.67138671875, \"cooperate\"=>-0.673828125, \"coup\"=>-0.56640625, \"defamationcase\"=>-0.0156707763671875, \"disaster\"=>-0.342529296875, \"legalaction\"=>10.96875, \"legalchange\"=>-0.52587890625, \"martiallaw\"=>-0.97216796875, \"mobilizesecurity\"=>-0.312255859375, \"praise\"=>-1.857421875, \"protest\"=>-0.671875, \"purge\"=>-0.5283203125, \"raid\"=>0.006866455078125, \"threaten\"=>0.01409912109375, \"violencelethal\"=>-0.07086181640625, \"violencenonlethal\"=>-1.3564453125}}, \"month\"=>11, \"year\"=>2012, \"RAI\"=>{\"event_type\"=>\"-999\", \"model_outputs\"=>{\"-999\"=>-0.322265625, \"arms_transfer_security_aid_assistance\"=>-0.76171875, \"bribery_economic_corruption\"=>2.123046875, \"diaspora_activation\"=>0.1064453125, \"diplomatic_mediation\"=>1.263671875, \"diplomatic_recognition\"=>-1.4140625, \"diplomatic_sanction\"=>-0.50341796875, \"diplomatic_statement\"=>1.373046875, \"diplomatic_visit\"=>1.37890625, \"economic_aid_assistance\"=>-0.55908203125, \"intelligence_counterintelligence\"=>3.244140625, \"investment\"=>-0.25146484375, \"joint_security_force_exercise\"=>0.07330322265625, \"media_campaign_intervention\"=>0.056610107421875, \"social_academic_cultural_activity\"=>-0.02435302734375, \"political_process_policy_intervention\"=>0.48828125, \"professional_cultural_exchange\"=>-0.274658203125, \"security_cooperation\"=>3.552734375, \"security_force_facility_presence\"=>-0.26416015625, \"official_security_force_facility_presence\"=>-0.57958984375, \"surveillance\"=>-0.447265625, \"tech_transfer_investment\"=>1.078125, \"trade_agreement_exchange\"=>-2.58984375, \"trade_financial_sanction\"=>-1.279296875, \"transnational_organization_crime\"=>-1.1494140625}}}",
"civic1_model_outputs_coup" => -0.56640625,
"RAI_model_outputs_security_force_facility_presence" => -0.26416015625,
"civic1_model_outputs_purge" => -0.5283203125,
"RAI_model_outputs_arms_transfer_security_aid_assistance" => -0.76171875,
"civic1_model_outputs_legalchange" => -0.52587890625,
"@version" => "1",
"RAI_model_outputs_diplomatic_statement" => 1.373046875,
"civic1_model_outputs_martiallaw" => -0.97216796875,
"RAI_model_outputs_professional_cultural_exchange" => -0.274658203125,
"civic1_model_outputs_violencenonlethal" => -1.3564453125,
"civic1_model_outputs_protest" => -0.671875,
"civic1_model_outputs_raid" => 0.006866455078125,
"source_domain" => "france24.com",
"civic1_model_outputs_disaster" => -0.342529296875,
"RAI_model_outputs_official_security_force_facility_presence" => -0.57958984375,
"filename" => "en_20121115-clinton-testify-benghazi-attack-republicans_1612938999.html",
"year" => 2012,
"civic1_model_outputs_praise" => -1.857421875,
"RAI_model_outputs_political_process_policy_intervention" => 0.48828125,
"RAI_model_outputs_transnational_organization_crime" => -1.1494140625,
"event_extracted" => 0,
"@timestamp" => 2021-04-08T22:02:43.766Z,
"civic1_model_outputs_changeelection" => -0.303466796875,
"civic1_model_outputs_threaten" => 0.01409912109375,
"month" => 11,
"location" => [
[0] "%{[location_lat]}",
[1] "%{[location_lon]}"
],
"RAI_model_outputs_diplomatic_mediation" => 1.263671875,
"RAI_model_outputs_-999" => -0.322265625,
"RAI_model_outputs_investment" => -0.25146484375,
"date_download" => "2021-02-10T06:36:39Z",
"title_page" => "Clinton to testify in Benghazi attack probe",
"logdate" => "2021-02-10T06:36:40+00:00",
"civic1_model_outputs_cooperate" => -0.673828125,
"RAI_model_outputs_tech_transfer_investment" => 1.078125,
"mongo_id" => "60237ef801e920023bd60068",
"description" => "Secretary of State Hillary Clinton agreed to testify in hearings on the September attack on the US mission in Benghazi, Libya on Thursday, as Republicans continued to fuel a feud over the handling of…",
"title_translated" => "Clinton to testify in Benghazi attack probe",
"RAI_model_outputs_diplomatic_recognition" => -1.4140625,
"RAI_model_outputs_diplomatic_sanction" => -0.50341796875,
"title" => "Clinton to testify in Benghazi attack probe"
}