Skip to content
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

Kibana Discover support kibana 7.15 #481

Merged
merged 3 commits into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Added support for markdown style formatting of aggregation tables - [#415](https://github.com/jertel/elastalert2/pull/415) - @Neuro-HSOC
- [OpsGenie] Add support for custom description - [#457](https://github.com/jertel/elastalert2/pull/457), [#460](https://github.com/jertel/elastalert2/pull/460) - @nickbabkin
- [Tencent SMS] Added support for Tencent SMS - [#470](https://github.com/jertel/elastalert2/pull/470) - @liuxingjun
- Add support for Kibana 7.15 for Kibana Discover - [#481](https://github.com/jertel/elastalert2/pull/481) - @nsano-rururu

## Other changes
- [Rule Test] Fix issue related to --start/--end/--days params - [#424](https://github.com/jertel/elastalert2/pull/424), [#433](https://github.com/jertel/elastalert2/pull/433) - @thican
Expand Down
14 changes: 7 additions & 7 deletions docs/source/ruletypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ Example usage::
generate_kibana_discover_url: True
kibana_discover_app_url: "http://localhost:5601/app/discover#/"
kibana_discover_index_pattern_id: "4babf380-c3b1-11eb-b616-1b59c2feec54"
kibana_discover_version: "7.14"
kibana_discover_version: "7.15"
kibana_discover_from_timedelta:
minutes: 10
kibana_discover_to_timedelta:
Expand All @@ -623,9 +623,9 @@ The currently supported versions of Kibana Discover are:

- `5.6`
- `6.0`, `6.1`, `6.2`, `6.3`, `6.4`, `6.5`, `6.6`, `6.7`, `6.8`
- `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `7.5`, `7.6`, `7.7`, `7.8`, `7.9`, `7.10`, `7.11`, `7.12`, `7.13`, `7.14`
- `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `7.5`, `7.6`, `7.7`, `7.8`, `7.9`, `7.10`, `7.11`, `7.12`, `7.13`, `7.14`, `7.15`

``kibana_discover_version: '7.14'``
``kibana_discover_version: '7.15'``

kibana_discover_index_pattern_id
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -2291,7 +2291,7 @@ Example mattermost_attach_kibana_discover_url, mattermost_kibana_discover_color,
generate_kibana_discover_url: True
kibana_discover_app_url: "http://localhost:5601/app/discover#/"
kibana_discover_index_pattern_id: "4babf380-c3b1-11eb-b616-1b59c2feec54"
kibana_discover_version: "7.14"
kibana_discover_version: "7.15"

# (Optional)
kibana_discover_from_timedelta:
Expand Down Expand Up @@ -2400,7 +2400,7 @@ Example opsgenie_details with kibana_discover_url::
generate_kibana_discover_url: True
kibana_discover_app_url: "http://localhost:5601/app/discover#/"
kibana_discover_index_pattern_id: "4babf380-c3b1-11eb-b616-1b59c2feec54"
kibana_discover_version: "7.14"
kibana_discover_version: "7.15"

# (Optional)
kibana_discover_from_timedelta:
Expand Down Expand Up @@ -2530,7 +2530,7 @@ Example rocket_chat_attach_kibana_discover_url, rocket_chat_kibana_discover_colo
generate_kibana_discover_url: True
kibana_discover_app_url: "http://localhost:5601/app/discover#/"
kibana_discover_index_pattern_id: "4babf380-c3b1-11eb-b616-1b59c2feec54"
kibana_discover_version: "7.14"
kibana_discover_version: "7.15"

# (Optional)
kibana_discover_from_timedelta:
Expand Down Expand Up @@ -2694,7 +2694,7 @@ Example slack_attach_kibana_discover_url, slack_kibana_discover_color, slack_kib
generate_kibana_discover_url: True
kibana_discover_app_url: "http://localhost:5601/app/discover#/"
kibana_discover_index_pattern_id: "4babf380-c3b1-11eb-b616-1b59c2feec54"
kibana_discover_version: "7.14"
kibana_discover_version: "7.15"

# (Optional)
kibana_discover_from_timedelta:
Expand Down
2 changes: 1 addition & 1 deletion elastalert/kibana_discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
kibana_default_timedelta = datetime.timedelta(minutes=10)

kibana5_kibana6_versions = frozenset(['5.6', '6.0', '6.1', '6.2', '6.3', '6.4', '6.5', '6.6', '6.7', '6.8'])
kibana7_versions = frozenset(['7.0', '7.1', '7.2', '7.3', '7.4', '7.5', '7.6', '7.7', '7.8', '7.9', '7.10', '7.11', '7.12', '7.13', '7.14'])
kibana7_versions = frozenset(['7.0', '7.1', '7.2', '7.3', '7.4', '7.5', '7.6', '7.7', '7.8', '7.9', '7.10', '7.11', '7.12', '7.13', '7.14', '7.15'])

def generate_kibana_discover_url(rule, match):
''' Creates a link for a kibana discover app. '''
Expand Down
2 changes: 1 addition & 1 deletion elastalert/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ properties:
### Kibana Discover App Link
generate_kibana_discover_url: {type: boolean}
kibana_discover_app_url: {type: string, format: uri}
kibana_discover_version: {type: string, enum: ['7.14', '7.13', '7.12', '7.11', '7.10', '7.9', '7.8', '7.7', '7.6', '7.5', '7.4', '7.3', '7.2', '7.1', '7.0', '6.8', '6.7', '6.6', '6.5', '6.4', '6.3', '6.2', '6.1', '6.0', '5.6']}
kibana_discover_version: {type: string, enum: ['7.15', '7.14', '7.13', '7.12', '7.11', '7.10', '7.9', '7.8', '7.7', '7.6', '7.5', '7.4', '7.3', '7.2', '7.1', '7.0', '6.8', '6.7', '6.6', '6.5', '6.4', '6.3', '6.2', '6.1', '6.0', '5.6']}
kibana_discover_index_pattern_id: {type: string, minLength: 1}
kibana_discover_columns: {type: array, items: {type: string, minLength: 1}, minItems: 1}
kibana_discover_from_timedelta: *timedelta
Expand Down
13 changes: 7 additions & 6 deletions tests/kibana_discover_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def test_generate_kibana_discover_url_with_kibana_5x_and_6x(kibana_version):
'7.11',
'7.12',
'7.13',
'7.14'
'7.14',
'7.15'
])
def test_generate_kibana_discover_url_with_kibana_7x(kibana_version):
url = generate_kibana_discover_url(
Expand Down Expand Up @@ -187,7 +188,7 @@ def test_generate_kibana_discover_url_with_from_timedelta():
url = generate_kibana_discover_url(
rule={
'kibana_discover_app_url': 'http://kibana:5601/#/discover',
'kibana_discover_version': '7.14',
'kibana_discover_version': '7.15',
'kibana_discover_index_pattern_id': 'd6cabfb6-aaef-44ea-89c5-600e9a76991a',
'kibana_discover_from_timedelta': timedelta(hours=1),
'timestamp_field': 'timestamp'
Expand Down Expand Up @@ -220,7 +221,7 @@ def test_generate_kibana_discover_url_with_from_timedelta_and_timeframe():
url = generate_kibana_discover_url(
rule={
'kibana_discover_app_url': 'http://kibana:5601/#/discover',
'kibana_discover_version': '7.14',
'kibana_discover_version': '7.15',
'kibana_discover_index_pattern_id': 'd6cabfb6-aaef-44ea-89c5-600e9a76991a',
'kibana_discover_from_timedelta': timedelta(hours=1),
'timeframe': timedelta(minutes=20),
Expand Down Expand Up @@ -254,7 +255,7 @@ def test_generate_kibana_discover_url_with_to_timedelta():
url = generate_kibana_discover_url(
rule={
'kibana_discover_app_url': 'http://kibana:5601/#/discover',
'kibana_discover_version': '7.14',
'kibana_discover_version': '7.15',
'kibana_discover_index_pattern_id': 'd6cabfb6-aaef-44ea-89c5-600e9a76991a',
'kibana_discover_to_timedelta': timedelta(hours=1),
'timestamp_field': 'timestamp'
Expand Down Expand Up @@ -287,7 +288,7 @@ def test_generate_kibana_discover_url_with_to_timedelta_and_timeframe():
url = generate_kibana_discover_url(
rule={
'kibana_discover_app_url': 'http://kibana:5601/#/discover',
'kibana_discover_version': '7.14',
'kibana_discover_version': '7.15',
'kibana_discover_index_pattern_id': 'd6cabfb6-aaef-44ea-89c5-600e9a76991a',
'kibana_discover_to_timedelta': timedelta(hours=1),
'timeframe': timedelta(minutes=20),
Expand Down Expand Up @@ -321,7 +322,7 @@ def test_generate_kibana_discover_url_with_timeframe():
url = generate_kibana_discover_url(
rule={
'kibana_discover_app_url': 'http://kibana:5601/#/discover',
'kibana_discover_version': '7.14',
'kibana_discover_version': '7.15',
'kibana_discover_index_pattern_id': 'd6cabfb6-aaef-44ea-89c5-600e9a76991a',
'timeframe': timedelta(minutes=20),
'timestamp_field': 'timestamp'
Expand Down