Created
September 3, 2021 13:12
-
-
Save walidum/56acf44ffec5cb9b01e99693aa6fe599 to your computer and use it in GitHub Desktop.
flattened and exception mappings management in elasticsearch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. | |
curl -XPUT "http://127.0.0.1:9200/demo-default/_doc/1" -d'{ | |
"message": "[5592:1:0309/123054.737712:ERROR:child_process_sandbox_support_impl_linux.cc(79)] FontService unique font name matching request did not receive a response.", | |
"fileset": { | |
"name": "syslog" | |
}, | |
"process": { | |
"name": "org.gnome.Shell.desktop", | |
"pid": 3383 | |
}, | |
"@timestamp": "2020-03-09T18:00:54.000+05:30", | |
"host": { | |
"hostname": "bionic", | |
"name": "bionic" | |
} | |
}' | |
2. | |
curl -XGET "http://127.0.0.1:9200/demo-default/_mapping?pretty=true" | |
3. | |
curl -XGET "http://127.0.0.1:9200/_cluster/state?pretty=true" >> es-cluster-state.json | |
4. | |
curl -XPUT "http://127.0.0.1:9200/demo-flattened" | |
5. | |
curl -XPUT "http://127.0.0.1:9200/demo-flattened/_mapping" -d'{ | |
"properties": { | |
"host": { | |
"type": "flattened" | |
} | |
} | |
}' | |
6. | |
curl -XPUT "http://127.0.0.1:9200/demo-flattened/_doc/1" -d'{ | |
"message": "[5592:1:0309/123054.737712:ERROR:child_process_sandbox_support_impl_linux.cc(79)] FontService unique font name matching request did not receive a response.", | |
"fileset": { | |
"name": "syslog" | |
}, | |
"process": { | |
"name": "org.gnome.Shell.desktop", | |
"pid": 3383 | |
}, | |
"@timestamp": "2020-03-09T18:00:54.000+05:30", | |
"host": { | |
"hostname": "bionic", | |
"name": "bionic" | |
} | |
}' | |
7. | |
curl -XGET "http://127.0.0.1:9200/demo-flattened/_mapping?pretty=true" | |
8. | |
curl -XPOST "http://127.0.0.1:9200/demo-flattened/_update/1" -d'{ | |
"doc" : { | |
"host" : { | |
"osVersion": "Bionic Beaver", | |
"osArchitecture":"x86_64" | |
} | |
} | |
}' | |
9. | |
curl -XGET "http://127.0.0.1:9200/demo-flattened/_search?pretty=true" -d'{ | |
"query": { | |
"term": { | |
"host": "Bionic Beaver" | |
} | |
} | |
}' | |
10. | |
curl -XGET "http://127.0.0.1:9200/demo-flattened/_search?pretty=true" -d'{ | |
"query": { | |
"term": { | |
"host.osVersion": "Bionic Beaver" | |
} | |
} | |
}' | |
11. | |
curl -XGET "http://127.0.0.1:9200/demo-flattened/_search?pretty=true" -d'{ | |
"query": { | |
"term": { | |
"host.osVersion": "Beaver" | |
} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment