Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamhowardtheduck/86ed3ebea49d31047c9dfa1ce5f70ad4 to your computer and use it in GitHub Desktop.
Save iamhowardtheduck/86ed3ebea49d31047c9dfa1ce5f70ad4 to your computer and use it in GitHub Desktop.
COVID-19 Time-series Deprecated Historical Data Logstash Pipeline
input {
file {
path => ["/COVID-19/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv", "/COVID-19/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Deaths.csv", "/COVID-19/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Recovered.csv" ]
start_position => "beginning"
} }
filter {
if [path] == "/COVID-19/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv" { mutate { add_field => { "tags" => "Confirmed" }}}
if [path] == "/COVID-19/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Recovered.csv" { mutate { add_field => { "tags" => "Recovered" }}}
if [path] == "/COVID-19/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Deaths.csv" { mutate { add_field => { "tags" => "Deaths" }}}
csv {
skip_empty_columns => true
skip_empty_rows => true
autodetect_column_names => false
columns =>
[ "Province/State","Country/Region","Lat","Long","1/22/20","1/23/20","1/24/20","1/25/20","1/26/20","1/27/20","1/28/20","1/29/20","1/30/20","1/31/20","2/1/20","2/2/20","2/3/20","2/4/20","2/5/20","2/6/20","2/7/20","2/8/20","2/9/20","2/10/20","2/11/20","2/12/20","2/13/20","2/14/20","2/15/20","2/16/20","2/17/20","2/18/20","2/19/20","2/20/20","2/21/20","2/22/20","2/23/20","2/24/20","2/25/20","2/26/20","2/27/20","2/28/20","2/29/20","3/1/20","3/2/20","3/3/20","3/4/20","3/5/20","3/6/20","3/7/20","3/8/20","3/9/20","3/10/20","3/11/20","3/12/20","3/13/20","3/14/20","3/15/20","3/16/20","3/17/20","3/18/20","3/19/20","3/20/20","3/21/20","3/22/20","3/23/20" ]
}
mutate { rename => { "Province/State" => "Province-State" }}
mutate { rename => { "Country/Region" => "Country" }}
mutate { update => { "1/22/20" => "1/22/2020.%{1/22/20}" }}
mutate { update => { "1/23/20" => "1/23/2020.%{1/23/20}" }}
mutate { update => { "1/24/20" => "1/24/2020.%{1/24/20}" }}
mutate { update => { "1/25/20" => "1/25/2020.%{1/25/20}" }}
mutate { update => { "1/26/20" => "1/26/2020.%{1/26/20}" }}
mutate { update => { "1/27/20" => "1/27/2020.%{1/27/20}" }}
mutate { update => { "1/28/20" => "1/28/2020.%{1/28/20}" }}
mutate { update => { "1/29/20" => "1/29/2020.%{1/29/20}" }}
mutate { update => { "1/30/20" => "1/30/2020.%{1/30/20}" }}
mutate { update => { "1/31/20" => "1/31/2020.%{1/31/20}" }}
mutate { update => { "2/1/20" => "2/1/2020.%{2/1/20}" }}
mutate { update => { "2/2/20" => "2/2/2020.%{2/2/20}" }}
mutate { update => { "2/3/20" => "2/3/2020.%{2/3/20}" }}
mutate { update => { "2/4/20" => "2/4/2020.%{2/4/20}" }}
mutate { update => { "2/5/20" => "2/5/2020.%{2/5/20}" }}
mutate { update => { "2/6/20" => "2/6/2020.%{2/6/20}" }}
mutate { update => { "2/7/20" => "2/7/2020.%{2/7/20}" }}
mutate { update => { "2/8/20" => "2/8/2020.%{2/8/20}" }}
mutate { update => { "2/9/20" => "2/9/2020.%{2/9/20}" }}
mutate { update => { "2/10/20" => "2/10/2020.%{2/10/20}" }}
mutate { update => { "2/11/20" => "2/11/2020.%{2/11/20}" }}
mutate { update => { "2/12/20" => "2/12/2020.%{2/12/20}" }}
mutate { update => { "2/13/20" => "2/13/2020.%{2/13/20}" }}
mutate { update => { "2/14/20" => "2/14/2020.%{2/14/20}" }}
mutate { update => { "2/15/20" => "2/15/2020.%{2/15/20}" }}
mutate { update => { "2/16/20" => "2/16/2020.%{2/16/20}" }}
mutate { update => { "2/17/20" => "2/17/2020.%{2/17/20}" }}
mutate { update => { "2/18/20" => "2/18/2020.%{2/18/20}" }}
mutate { update => { "2/19/20" => "2/19/2020.%{2/19/20}" }}
mutate { update => { "2/20/20" => "2/20/2020.%{2/20/20}" }}
mutate { update => { "2/21/20" => "2/21/2020.%{2/21/20}" }}
mutate { update => { "2/22/20" => "2/22/2020.%{2/22/20}" }}
mutate { update => { "2/23/20" => "2/23/2020.%{2/23/20}" }}
mutate { update => { "2/24/20" => "2/24/2020.%{2/24/20}" }}
mutate { update => { "2/25/20" => "2/25/2020.%{2/25/20}" }}
mutate { update => { "2/26/20" => "2/26/2020.%{2/26/20}" }}
mutate { update => { "2/27/20" => "2/27/2020.%{2/27/20}" }}
mutate { update => { "2/28/20" => "2/28/2020.%{2/28/20}" }}
mutate { update => { "2/29/20" => "2/29/2020.%{2/29/20}" }}
mutate { update => { "3/1/20" => "3/1/2020.%{3/1/20}" }}
mutate { update => { "3/2/20" => "3/2/2020.%{3/2/20}" }}
mutate { update => { "3/3/20" => "3/3/2020.%{3/3/20}" }}
mutate { update => { "3/4/20" => "3/4/2020.%{3/4/20}" }}
mutate { update => { "3/5/20" => "3/5/2020.%{3/5/20}" }}
mutate { update => { "3/6/20" => "3/6/2020.%{3/6/20}" }}
mutate { update => { "3/7/20" => "3/7/2020.%{3/7/20}" }}
mutate { update => { "3/8/20" => "3/8/2020.%{3/8/20}" }}
mutate { update => { "3/9/20" => "3/9/2020.%{3/9/20}" }}
mutate { update => { "3/10/20" => "3/10/2020.%{3/10/20}" }}
mutate { update => { "3/11/20" => "3/11/2020.%{3/11/20}" }}
mutate { update => { "3/12/20" => "3/12/2020.%{3/12/20}" }}
mutate { update => { "3/13/20" => "3/13/2020.%{3/13/20}" }}
mutate { update => { "3/14/20" => "3/14/2020.%{3/14/20}" }}
mutate { update => { "3/15/20" => "3/15/2020.%{3/15/20}" }}
mutate { update => { "3/16/20" => "3/16/2020.%{3/16/20}" }}
mutate { update => { "3/17/20" => "3/17/2020.%{3/17/20}" }}
mutate { update => { "3/18/20" => "3/18/2020.%{3/18/20}" }}
mutate { update => { "3/19/20" => "3/19/2020.%{3/19/20}" }}
mutate { update => { "3/20/20" => "3/20/2020.%{3/20/20}" }}
mutate { update => { "3/21/20" => "3/21/2020.%{3/21/20}" }}
mutate { update => { "3/22/20" => "3/22/2020.%{3/22/20}" }}
mutate { update => { "3/23/20" => "3/23/2020.%{3/23/20}" }}
mutate { add_field => { "corona.geo_point" => "%{Lat},%{Long}" }}
clone { clones => [ "1/22/20", "1/23/20","1/24/20", "1/25/20", "1/26/20", "1/27/20", "1/28/20", "1/29/20", "1/30/20", "1/31/20", "2/1/20", "2/2/20", "2/3/20", "2/4/20", "2/5/20", "2/6/20", "2/7/20", "2/8/20", "2/9/20", "2/10/20", "2/11/20", "2/12/20", "2/13/20", "2/14/20", "2/15/20", "2/16/20", "2/17/20", "2/18/20", "2/19/20", "2/20/20", "2/21/20", "2/22/20", "2/23/20", "2/24/20", "2/25/20", "2/26/20", "2/27/20", "2/28/20", "2/29/20", "3/1/20", "3/2/20", "3/3/20", "3/4/20", "3/5/20", "3/6/20", "3/7/20", "3/8/20", "3/9/20", "3/10/20", "3/11/20", "3/12/20", "3/13/20", "3/14/20", "3/15/20", "3/16/20", "3/17/20", "3/18/20", "3/19/20", "3/20/20", "3/21/20", "3/22/20", "3/23/20"]}
if [type] == "1/22/20" { prune { whitelist_names => [ "^1/22/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "1/22/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "1/22/20" ]}}
if [type] == "1/23/20" { prune { whitelist_names => [ "^1/23/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "1/23/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "1/23/20" ]}}
if [type] == "1/24/20" { prune { whitelist_names => [ "^1/24/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "1/24/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "1/24/20" ]}}
if [type] == "1/25/20" { prune { whitelist_names => [ "^1/25/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "1/25/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "1/25/20" ]}}
if [type] == "1/26/20" { prune { whitelist_names => [ "^1/26/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "1/26/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "1/26/20" ]}}
if [type] == "1/27/20" { prune { whitelist_names => [ "^1/27/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "1/27/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "1/27/20" ]}}
if [type] == "1/28/20" { prune { whitelist_names => [ "^1/28/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "1/28/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "1/28/20" ]}}
if [type] == "1/29/20" { prune { whitelist_names => [ "^1/29/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "1/29/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "1/29/20" ]}}
if [type] == "1/30/20" { prune { whitelist_names => [ "^1/30/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "1/30/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "1/30/20" ]}}
if [type] == "1/31/20" { prune { whitelist_names => [ "^1/31/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "1/31/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "1/31/20" ]}}
if [type] == "2/1/20" { prune { whitelist_names => [ "^2/1/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/1/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/1/20" ]}}
if [type] == "2/2/20" { prune { whitelist_names => [ "^2/2/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/2/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/2/20" ]}}
if [type] == "2/3/20" { prune { whitelist_names => [ "^2/3/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/3/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/3/20" ]}}
if [type] == "2/4/20" { prune { whitelist_names => [ "^2/4/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/4/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/4/20" ]}}
if [type] == "2/5/20" { prune { whitelist_names => [ "^2/5/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/5/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/5/20" ]}}
if [type] == "2/6/20" { prune { whitelist_names => [ "^2/6/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/6/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/6/20" ]}}
if [type] == "2/7/20" { prune { whitelist_names => [ "^2/7/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/7/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/7/20" ]}}
if [type] == "2/8/20" { prune { whitelist_names => [ "^2/8/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/8/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/8/20" ]}}
if [type] == "2/9/20" { prune { whitelist_names => [ "^2/9/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/9/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/9/20" ]}}
if [type] == "2/10/20" { prune { whitelist_names => [ "^2/10/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/10/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/10/20" ]}}
if [type] == "2/11/20" { prune { whitelist_names => [ "^2/11/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/11/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/11/20" ]}}
if [type] == "2/12/20" { prune { whitelist_names => [ "^2/12/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/12/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/12/20" ]}}
if [type] == "2/13/20" { prune { whitelist_names => [ "^2/13/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/13/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/13/20" ]}}
if [type] == "2/14/20" { prune { whitelist_names => [ "^2/14/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/14/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/14/20" ]}}
if [type] == "2/15/20" { prune { whitelist_names => [ "^2/15/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/15/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/15/20" ]}}
if [type] == "2/16/20" { prune { whitelist_names => [ "^2/16/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/16/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/16/20" ]}}
if [type] == "2/17/20" { prune { whitelist_names => [ "^2/17/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/17/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/17/20" ]}}
if [type] == "2/18/20" { prune { whitelist_names => [ "^2/18/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/18/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/18/20" ]}}
if [type] == "2/19/20" { prune { whitelist_names => [ "^2/19/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/19/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/19/20" ]}}
if [type] == "2/20/20" { prune { whitelist_names => [ "^2/20/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/20/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/20/20" ]}}
if [type] == "2/21/20" { prune { whitelist_names => [ "^2/21/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/21/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/21/20" ]}}
if [type] == "2/22/20" { prune { whitelist_names => [ "^2/22/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/22/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/22/20" ]}}
if [type] == "2/23/20" { prune { whitelist_names => [ "^2/23/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/23/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/23/20" ]}}
if [type] == "2/24/20" { prune { whitelist_names => [ "^2/24/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/24/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/24/20" ]}}
if [type] == "2/25/20" { prune { whitelist_names => [ "^2/25/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/25/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/25/20" ]}}
if [type] == "2/26/20" { prune { whitelist_names => [ "^2/26/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/26/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/26/20" ]}}
if [type] == "2/27/20" { prune { whitelist_names => [ "^2/27/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/27/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/27/20" ]}}
if [type] == "2/28/20" { prune { whitelist_names => [ "^2/28/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/28/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/28/20" ]}}
if [type] == "2/29/20" { prune { whitelist_names => [ "^2/29/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "2/29/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "2/29/20" ]}}
if [type] == "3/1/20" { prune { whitelist_names => [ "^3/1/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/1/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/1/20" ]}}
if [type] == "3/2/20" { prune { whitelist_names => [ "^3/2/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/2/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/2/20" ]}}
if [type] == "3/3/20" { prune { whitelist_names => [ "^3/3/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/3/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/3/20" ]}}
if [type] == "3/4/20" { prune { whitelist_names => [ "^3/4/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/4/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/4/20" ]}}
if [type] == "3/5/20" { prune { whitelist_names => [ "^3/5/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/5/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/5/20" ]}}
if [type] == "3/6/20" { prune { whitelist_names => [ "^3/6/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/6/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/6/20" ]}}
if [type] == "3/7/20" { prune { whitelist_names => [ "^3/7/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/7/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/7/20" ]}}
if [type] == "3/8/20" { prune { whitelist_names => [ "^3/8/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/8/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/8/20" ]}}
if [type] == "3/9/20" { prune { whitelist_names => [ "^3/9/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/9/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/9/20" ]}}
if [type] == "3/10/20" { prune { whitelist_names => [ "^3/10/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/10/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/10/20" ]}}
if [type] == "3/11/20" { prune { whitelist_names => [ "^3/11/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/11/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/11/20" ]}}
if [type] == "3/12/20" { prune { whitelist_names => [ "^3/12/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/12/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/12/20" ]}}
if [type] == "3/13/20" { prune { whitelist_names => [ "^3/13/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/13/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/13/20" ]}}
if [type] == "3/14/20" { prune { whitelist_names => [ "^3/14/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/14/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/14/20" ]}}
if [type] == "3/15/20" { prune { whitelist_names => [ "^3/15/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/15/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/15/20" ]}}
if [type] == "3/16/20" { prune { whitelist_names => [ "^3/16/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/16/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/16/20" ]}}
if [type] == "3/17/20" { prune { whitelist_names => [ "^3/17/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/17/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/17/20" ]}}
if [type] == "3/18/20" { prune { whitelist_names => [ "^3/18/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/18/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/18/20" ]}}
if [type] == "3/19/20" { prune { whitelist_names => [ "^3/19/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/19/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/19/20" ]}}
if [type] == "3/20/20" { prune { whitelist_names => [ "^3/20/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/20/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/20/20" ]}}
if [type] == "3/21/20" { prune { whitelist_names => [ "^3/21/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/21/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/21/20" ]}}
if [type] == "3/22/20" { prune { whitelist_names => [ "^3/22/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/22/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/22/20" ]}}
if [type] == "3/23/20" { prune { whitelist_names => [ "^3/23/20$", "Province-State", "Country", "corona.geo_point", "tags" ] }dissect { mapping => { "3/23/20" => "%{LastDate}.%{Count}" }}date { match => [ "LastDate", "M/d/yyyy" ] remove_field => [ "3/23/20" ]}}
mutate { remove_field => ["message",1/22/20","1/23/20","1/24/20","1/25/20","1/26/20","1/27/20","1/28/20","1/29/20","1/30/20","1/31/20","2/1/20","2/2/20","2/3/20","2/4/20","2/5/20","2/6/20","2/7/20","2/8/20","2/9/20","2/10/20","2/11/20","2/12/20","2/13/20","2/14/20","2/15/20","2/16/20","2/17/20","2/18/20","2/19/20","2/20/20","2/21/20","2/22/20","2/23/20","2/24/20","2/25/20","2/26/20","2/27/20","2/28/20","2/29/20","3/1/20","3/2/20","3/3/20","3/4/20","3/5/20","3/6/20","3/7/20","3/8/20","3/9/20","3/10/20","3/11/20","3/12/20","3/13/20","3/14/20","3/15/20","3/16/20","3/17/20","3/18/20","3/19/20","3/20/20","3/21/20","3/22/20","3/23/20"] }
if [type] == " " { drop {}}
if [tags] == "Confirmed" { mutate { rename => { "Count" => "Confirmed_Count" }}}
if [tags] == "Deaths" { mutate { rename => { "Count" => "Death_Count" }}}
if [tags] == "Recovered" { mutate { rename => { "Count" => "Recovered_Count" }}}
if [Country] == "US" { mutate { update => { "Country" => "United States" }}}
if [Country] == "Bahamas, The" { mutate { update => { "Country" => "Bahamas" }}}
if [Country] == "Taiwan*" { mutate { update => { "Country" => "Taiwan" }}}
}
@iamhowardtheduck
Copy link
Author

Updating code shortly with an improved process to incorporate historical data; stay tuned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment