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.16 #612

Merged
merged 2 commits into from
Dec 14, 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 @@ -17,6 +17,7 @@
## New features
- Add metric_agg_script to MetricAggregationRule [#558](https://github.com/jertel/elastalert2/pull/558) - @dequis
- [Alertmanager]Add support for basic authentication - [#575](https://github.com/jertel/elastalert2/pull/575) - @nsano-rururu
- Add support for Kibana 7.16 for Kibana Discover - [#612](https://github.com/jertel/elastalert2/pull/612) - @nsano-rururu

## Other changes
- sphinx 4.2.0 to 4.3.0 and tzlocal==2.1 - [#561](https://github.com/jertel/elastalert2/pull/561) - @nsano-rururu
Expand Down
2 changes: 1 addition & 1 deletion docs/source/ruletypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ 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.15`
- `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`, `7.16`

``kibana_discover_version: '7.15'``

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', '7.15'])
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', '7.16'])

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 @@ -256,7 +256,7 @@ properties:
generate_kibana_discover_url: {type: boolean}
shorten_kibana_discover_url: {type: boolean}
kibana_discover_app_url: {type: string}
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_version: {type: string, enum: ['7.16', '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
15 changes: 8 additions & 7 deletions tests/kibana_discover_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def test_generate_kibana_discover_url_with_kibana_5x_and_6x(kibana_version):
'7.12',
'7.13',
'7.14',
'7.15'
'7.15',
'7.16'
])
def test_generate_kibana_discover_url_with_kibana_7x(kibana_version):
url = generate_kibana_discover_url(
Expand Down Expand Up @@ -92,7 +93,7 @@ def test_generate_kibana_discover_url_with_relative_kinbana_discover_app_url():
url = generate_kibana_discover_url(
rule={
'kibana_discover_app_url': 'app/discover#/',
'kibana_discover_version': '7.15',
'kibana_discover_version': '7.16',
'kibana_discover_index_pattern_id': '620ad0e6-43df-4557-bda2-384960fa9086',
'timestamp_field': 'timestamp'
},
Expand Down Expand Up @@ -220,7 +221,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.15',
'kibana_discover_version': '7.16',
'kibana_discover_index_pattern_id': 'd6cabfb6-aaef-44ea-89c5-600e9a76991a',
'kibana_discover_from_timedelta': timedelta(hours=1),
'timestamp_field': 'timestamp'
Expand Down Expand Up @@ -253,7 +254,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.15',
'kibana_discover_version': '7.16',
'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 @@ -287,7 +288,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.15',
'kibana_discover_version': '7.16',
'kibana_discover_index_pattern_id': 'd6cabfb6-aaef-44ea-89c5-600e9a76991a',
'kibana_discover_to_timedelta': timedelta(hours=1),
'timestamp_field': 'timestamp'
Expand Down Expand Up @@ -320,7 +321,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.15',
'kibana_discover_version': '7.16',
'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 @@ -354,7 +355,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.15',
'kibana_discover_version': '7.16',
'kibana_discover_index_pattern_id': 'd6cabfb6-aaef-44ea-89c5-600e9a76991a',
'timeframe': timedelta(minutes=20),
'timestamp_field': 'timestamp'
Expand Down