Graylog2-server: Optional field became required after upgrading to 2.4.6-1

Created on 19 Jul 2018  路  3Comments  路  Source: Graylog2/graylog2-server

In 2.4.5 we're able to query /search/universal/keyword with the query and range. After upgrading to 2.4.6 the same scripts replied with {u'message': u'Missing required parameterfields', u'type': u'ApiError'} Downgrading to 2.4.5 resolved the issue.

Steps to Reproduce (for bugs)

The URL we use in the python script is /api/search/universal/keyword?query=source%3A%22{0}%22%20OR%20gl2_remote_ip%3A%22{1}%22&keyword=last%2030%20days&limit=1&decorate=true"

Adding fields to the URL did not solve the issue.

Context

This is for an Icinga2 plugin that checks the hostname in icinga2 against the source in graylog for continuity between the systems.

Your Environment

  • Graylog Version: 2.4.6 gave us the error, 2.4.5 worked as expected.
  • Elasticsearch Version: 5.6.7
  • MongoDB Version: 1:2.6.10-0ubuntu1
  • Operating System: Ubuntu 16.04.4 LTS

Most helpful comment

There hasn't been any change in the optionality of these parameters between Graylog 2.4.5 and 2.4.6.

See https://github.com/Graylog2/graylog2-server/compare/2.4.5...2.4.6 for a complete diff.

https://github.com/Graylog2/graylog2-server/blob/2.4.5/graylog2-server/src/main/java/org/graylog2/rest/resources/search/KeywordSearchResource.java#L87-L97

However, the fields parameter is required when exporting the search result as CSV file:
https://github.com/Graylog2/graylog2-server/blob/2.4.5/graylog2-server/src/main/java/org/graylog2/rest/resources/search/KeywordSearchResource.java#L127-L133

Make sure to send a valid Accept header with your requests to the Graylog REST API, i. e. Accept: application/json in this case.

All 3 comments

There hasn't been any change in the optionality of these parameters between Graylog 2.4.5 and 2.4.6.

See https://github.com/Graylog2/graylog2-server/compare/2.4.5...2.4.6 for a complete diff.

https://github.com/Graylog2/graylog2-server/blob/2.4.5/graylog2-server/src/main/java/org/graylog2/rest/resources/search/KeywordSearchResource.java#L87-L97

However, the fields parameter is required when exporting the search result as CSV file:
https://github.com/Graylog2/graylog2-server/blob/2.4.5/graylog2-server/src/main/java/org/graylog2/rest/resources/search/KeywordSearchResource.java#L127-L133

Make sure to send a valid Accept header with your requests to the Graylog REST API, i. e. Accept: application/json in this case.

Adding headers = {'Accept': 'application/json'} fixed it and we upgraded to 2.4.6. Thanks for the support.

Thanks for the information, this fixed my problem with the /relative search endpoint as well

Was this page helpful?
0 / 5 - 0 ratings