Bug 1358674

Summary: "archive" link does not automatically select correct index/pattern
Product: OpenShift Container Platform Reporter: Alexander Koksharov <akokshar>
Component: Management ConsoleAssignee: bpeterse
Status: CLOSED ERRATA QA Contact: Xia Zhao <xiazhao>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.2.0CC: akokshar, aos-bugs, ewolinet, gpei, jforrest, jokerman, lmeyer, misalunk, mmccomas, steven, yanpzhan
Target Milestone: ---   
Target Release: 3.2.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: atomic-openshift-3.2.1.13-1.git.0.e438b0e.el7 Doc Type: Bug Fix
Doc Text:
A recent change to logging components altered the location of the default indexes resulting in the 'Log Archive' link showing no results. The console has been updated to link to the new location.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-11 18:38:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alexander Koksharov 2016-07-21 09:02:19 UTC
Created attachment 1182405 [details]
logs for test described in "description"

Description of problem:
When we click on the "archive" link in the "logs" section of the OpenShift Console we are correctly redirected to Kibana.  However we have the issue that not the correct index is selected.  Kibana complains that the specified pattern cannot be found and hence falls back to the default.


For these tests/logs I used the following:
- project/namespace: tst-es
- pod: cakephp-example-1-zxh7o

The URL that is generated when clicking on the "archive" link:
https://os-logs.os.server.lan/#/discover?_g=(time:(from:now-1w,mode:relative,to:now))&_a=(columns:!(kubernetes_container_name,cakephp-example),index:'dev-halleluja.1a9362e4-2d79-11e6-8591-001a4a010184.*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'kubernetes_pod_name:%20cakephp-example-1-zxh7o%20%26%26%20kubernetes_namespace_name:%20tst-es')),sort:!(time,desc))

This translates into the following query string in Kibana:
kubernetes_pod_name: cakephp-example-1-zxh7o && kubernetes_namespace_name: tst-es (with the incorrect index selected: dev-halleluja.1a9362e4-2d79-11e6-8591-001a4a010184.*)

logs/output attached

Version-Release number of selected component (if applicable):
3.2

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Alexander Koksharov 2016-07-25 10:18:54 UTC
Below is the requested HTML code:
-----
<input type="hidden" name="redirect" value="/#/discover?_g=(time:(from:now-1w,mode:relative,to:now))&amp;_a=(columns:!(kubernetes_container_name,cakephp-example),index:'tst-es.*',query:(query_string:(analyze_wildcard:!t,query:'kubernetes_pod_name: cakephp-example-1-zxh7o %26%26 kubernetes_namespace_name: tst-es')),sort:!(time,desc))#console_container_name=cakephp-example&amp;console_back_url=https%253A%252F%252Fos-cluster.server.lan%253A8443%252Fconsole%252Fproject%252Ftst-es%252Fbrowse%252Fpods%252Fcakephp-example-1-zxh7o">
-----

The above code seems to be correct.  What happens is that you are redirected to the above link, but as the index is not found you ge redirected to the default.

Comment 4 Jessica Forrester 2016-07-25 22:45:00 UTC
@lmeyer should we not be including the index in the link?  Is there anything the console team can actually do about this or should it get assigned back to Logging?

Comment 5 Luke Meyer 2016-07-26 12:52:01 UTC
@jforrest My question was a red herring. I believe what happened is that the index format changed and nobody told you. The index pattern was <project-name>.* and is now (since some 3.2 security update) supposed to be <project-name>.<project-uuid>.* - I don't have an install handy to check but I believe that's what Kibana/ES are pre-creating and expecting to see. Going to tag Eric on this as he would know for sure.

Comment 7 bpeterse 2016-08-01 20:19:51 UTC
working with @ewolinetz to get this updated.

Comment 8 bpeterse 2016-08-03 18:05:13 UTC
PR opened: https://github.com/openshift/origin-web-console/pull/274

Comment 9 openshift-github-bot 2016-08-03 18:33:31 UTC
Commit pushed to master at https://github.com/openshift/origin-web-console

https://github.com/openshift/origin-web-console/commit/a702310c2c92e6784bc900db5f679a65f2e4ccd9
Fix bug 1358674: "archive" link does not automatically select correct index/pattern

Comment 10 bpeterse 2016-08-03 19:23:57 UTC
backport to 3.2: https://github.com/openshift/ose/pull/327

Comment 11 Yadan Pei 2016-08-04 07:17:08 UTC
Will test when PR https://github.com/openshift/ose/pull/327 is merged

Comment 15 errata-xmlrpc 2016-08-11 18:38:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1608