You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Krisztian Kasa (JIRA)" <ji...@apache.org> on 2018/09/04 06:52:00 UTC
[jira] [Resolved] (AMBARI-24343) [LogSearch] Wrong (error) response
format
[ https://issues.apache.org/jira/browse/AMBARI-24343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Krisztian Kasa resolved AMBARI-24343.
-------------------------------------
Resolution: Fixed
> [LogSearch] Wrong (error) response format
> -----------------------------------------
>
> Key: AMBARI-24343
> URL: https://issues.apache.org/jira/browse/AMBARI-24343
> Project: Ambari
> Issue Type: Bug
> Components: ambari-logsearch
> Affects Versions: 2.7.1
> Reporter: Krisztian Kasa
> Assignee: Krisztian Kasa
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.7.2
>
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> When I call the
> {noformat}
> /shipper/input/\{clusterName}/services/\{serviceName}
> {noformat}
> api endpoint with wrong json schema the backend responses with plain text body instead of json or empty body.
> For example:
> {code:json}
> {
> "input": [
> {
> "type": "zookeeper",
> "rowtype": "service",
> "path": "/var/log/zookeeper/zookeeper*.log"
> }
> ],
> "filter": [
> {
> "filter": "grok",
> "conditions": {
> "fieldss": {
> "type": [
> "zookeeper"
> ]
> }
> },
> "skipOnError": false,
> "deepExtract": false,
> "post_map_values": {
> "logtime": [
> {
> "map_date": {
> "target_date_pattern": "yyyy-MM-dd HH:mm:ss,SSS"
> }
> }
> ]
> },
> "log4j_format": "%d\{ISO8601} - %-5p [%t:%C\{1}@%L] - %m%n",
> "multiline_pattern": "^(%\{TIMESTAMP_ISO8601:logtime})",
> "message_pattern": "(?m)^%\{TIMESTAMP_ISO8601:logtime}%\{SPACE}-%\{SPACE}%\{LOGLEVEL:level}%\{SPACE}\\[%\{DATA:thread_name}\\@%\{INT:line_number}\\]%\{SPACE}-%\{SPACE}%\{GREEDYDATA:log_message}"
> }
> ]
> }
> {code}
> Where the `fieldss` is not a valid JSON key.
> The response plain text body:
> {code:javascript}
> Unrecognized field "fieldss" (class org.apache.ambari.logsearch.model.common.LSServerConditions), not marked as ignorable (one known property: "fields"])
> at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: org.apache.ambari.logsearch.model.common.LSServerInputConfig["filter"]->org.apache.ambari.logsearch.model.common.LSServerFilterGrok["conditions"]->org.apache.ambari.logsearch.model.common.LSServerConditions["fieldss"])
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)