Hello all,
I would like your support in defining a proper filter for importing the following JSON object:
{
"status": "ok",
"message-type": "work-list",
"message-version": "1.0.0",
"message": {
"facets": {},
"total-results": 801,
"items": [
{
"volume": "69",
"issue": "3",
"title": [
"Non-Hermitian physics"
],
"URL": "http://dx.doi.org/10.1080/00018732.2021.1876991"
},
{
"volume": "69",
"issue": "2",
"title": [
"Correction"
],
"URL": "http://dx.doi.org/10.1080/00018732.2020.1859069"
}
],
"items-per-page": 5,
"query": {
"start-index": 0,
"search-terms": null
}
}
}
The intention is to import the message field and split "items" as separate docs/searchable fields.
Reading into the forums and other helpful posts, I have reached to the following filter file (I added JSON section twice with source message as my object has a message field).
input {
file {
#type => "json"
start_position => "beginning"
path => "D:/elastic/articles-file.json"
sincedb_path => "NUL"
}
}
filter {
json {
source => "message"
}
json {
source => "message"
}
split {
field => "items"
}
mutate {
remove_field => ["message", "@timestamp", "path", "host", "@version"]
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "articles"
}
stdout {}
}
Logstash pipeline seems to run indefinitely with the above filter.
I'm new to Elasticsearch stack and would appreciate your support.
Thank you,
Omran