-
Notifications
You must be signed in to change notification settings - Fork 82
[Doc] database auto-update and database metrics #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kaisecheng
merged 4 commits into
logstash-plugins:master
from
kaisecheng:doc_geoip_7_14
Jun 23, 2021
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,9 +43,7 @@ If you would like to get Autonomous System Number(ASN) information, you can use | |||||||
| https://www.maxmind.com[MaxMind] changed from releasing the GeoIP database under | ||||||||
| a Creative Commons (CC) license to a proprietary end-user license agreement | ||||||||
| (EULA). The MaxMind EULA requires Logstash to update the MaxMind database | ||||||||
| within 30 days of a database update. If Logstash fails to download the database | ||||||||
| for 30 days, the geoip filter will stop enriching events in order to maintain compliance. | ||||||||
| Events will be tagged with `_geoip_expired_database` tag to facilitate the handling of this situation. | ||||||||
| within 30 days of a database update. | ||||||||
|
|
||||||||
| The GeoIP filter plugin can manage the database for users running the Logstash default | ||||||||
| distribution, or you can manage | ||||||||
|
|
@@ -57,6 +55,77 @@ Otherwise, you are responsible for maintaining compliance. | |||||||
| The Logstash open source distribution uses the MaxMind Creative Commons license | ||||||||
| database by default. | ||||||||
|
|
||||||||
| [id="plugins-{type}s-{plugin}-database_auto"] | ||||||||
| ==== Database Auto-update | ||||||||
|
|
||||||||
| This plugin bundles Creative Commons (CC) license databases. | ||||||||
| In air-gapped environments, Logstash can use CC license databases indefinitely. | ||||||||
| Logstash checks for database updates every day. It downloads the latest and can replace the old database | ||||||||
| while the plugin is running. | ||||||||
| After Logstash downloads EULA license databases, it will not fallback to CC license databases. | ||||||||
|
|
||||||||
| If Logstash fails to download the database for 30 days, | ||||||||
| the geoip filter will stop enriching events in order to maintain compliance. | ||||||||
| Events will be tagged with `_geoip_expired_database` tag to facilitate the handling of this situation. | ||||||||
|
|
||||||||
| TIP: When possible, allow Logstash to access the internet to download databases so that they are always up-to-date. | ||||||||
|
|
||||||||
| [id="plugins-{type}s-{plugin}-metrics"] | ||||||||
| ==== Database Metrics | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
| You can monitor database status through the {logstash-ref}/node-stats-api.html#node-stats-api[Node Stats API]. | ||||||||
|
|
||||||||
| The following request returns a JSON document containing database manager stats, | ||||||||
| including: | ||||||||
|
|
||||||||
| * database status and freshness | ||||||||
| ** `geoip_download_manager.database.*.status` | ||||||||
| *** `init` : initial CC database status | ||||||||
| *** `up_to_date` : using up-to-date EULA database | ||||||||
| *** `to_be_expired` : 25 days without calling service | ||||||||
| *** `expired` : 30 days without calling service | ||||||||
| ** `fail_check_in_days` : number of days Logstash fails to call service since the last success | ||||||||
| * info about download successes and failures | ||||||||
| ** `geoip_download_manager.download_stats.successes` number of successful checks and downloads | ||||||||
| ** `geoip_download_manager.download_stats.failures` number of failed check or download | ||||||||
| ** `geoip_download_manager.download_stats.status` | ||||||||
| *** `updating` : check and download at the moment | ||||||||
| *** `succeeded` : last download succeed | ||||||||
| *** `failed` : last download failed | ||||||||
|
|
||||||||
| [source,js] | ||||||||
| -------------------------------------------------- | ||||||||
| curl -XGET 'localhost:9600/_node/stats/geoip_download_manager?pretty' | ||||||||
| -------------------------------------------------- | ||||||||
|
|
||||||||
| Example response: | ||||||||
|
|
||||||||
| [source,js] | ||||||||
| -------------------------------------------------- | ||||||||
| { | ||||||||
| "geoip_download_manager" : { | ||||||||
| "database" : { | ||||||||
| "ASN" : { | ||||||||
| "status" : "up_to_date", | ||||||||
| "fail_check_in_days" : 0, | ||||||||
| "last_updated_at": "2021-06-21T16:06:54+02:00" | ||||||||
| }, | ||||||||
| "City" : { | ||||||||
| "status" : "up_to_date", | ||||||||
| "fail_check_in_days" : 0, | ||||||||
| "last_updated_at": "2021-06-21T16:06:54+02:00" | ||||||||
| } | ||||||||
| }, | ||||||||
| "download_stats" : { | ||||||||
| "successes" : 15, | ||||||||
| "failures" : 1, | ||||||||
| "last_checked_at" : "2021-06-21T16:07:03+02:00", | ||||||||
| "status" : "succeeded" | ||||||||
| } | ||||||||
| } | ||||||||
| } | ||||||||
| -------------------------------------------------- | ||||||||
|
|
||||||||
| ==== Details | ||||||||
|
|
||||||||
| A `[geoip][location]` field is created if | ||||||||
|
|
||||||||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.