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

Error: rison decoder error #14

Closed
ameygat opened this issue Jul 16, 2018 · 3 comments
Closed

Error: rison decoder error #14

ameygat opened this issue Jul 16, 2018 · 3 comments

Comments

@ameygat
Copy link

ameygat commented Jul 16, 2018

I am having following code on my iframe side:

<script type="text/javascript">
                    function setBrowserFrameSource(){
                        alert(document.getElementById("searchval").value);
                        var myIframe = document.getElementById("guestFrame");
                        iframeUrl = myIframe.src
                        alert(iframeUrl);
                        myIframe.contentWindow.postMessage('searchRequest###' + iframeUrl, '*');
                    }

                </script>

                <p>
                <form name="f">
                    <input type="text" id="searchval" name="searchval" value=""/>
                    <input style="width:8%;" type="button" value="Go" onclick="setBrowserFrameSource(); return false;"/>
                </form>
        
                </p>
                <iframe id="guestFrame" name="guestFrame" frameborder=0 src="http://localhost:5601/app/kibana#/dashboard/AWRhEW7v3SRVv-T8QsdF?embed=true&_g=(refreshInterval%3A(display%3AOff%2Cpause%3A!f%2Cvalue%3A0)%2Ctime%3A(from%3Anow-6M%2Cmode%3Aquick%2Cto%3Anow))" height="800" width="100%">
                

When I click on the button the function does get called but I get following error on the UI

Fatal Error
Error: rison decoder error: decode input must be a string (http://localhost:5601/bundles/commons.bundle.js?v=15543:69)

Version: 5.6.2
Build: 15543

Error: Error: rison decoder error: decode input must be a string (http://localhost:5601/bundles/commons.bundle.js?v=15543:69)
[2502]/window.onerror@http://localhost:5601/bundles/commons.bundle.js?v=15543:115:13807

Also I am confused where to include the search query does it go in the URL or instead of the second parameter '*' ?

@bondib
Copy link
Owner

bondib commented Jul 16, 2018

Window.postMessage() - is a reg. Web APIs.
The '*' parameter stands fro cross domain communication - you should leave it as is.

Regarding the error you're getting - you can't just send in the query info like that.
Kibana expects APP-STATE-DATA and GLOBAL-STATE-DATA objects - which should be encoded using rison.

iframeFinalUrl is your kibana URI containing the complete dashboard data such as: http://{KIBANA-HOST}/app/kibana#/dashboard/{OPTIONAL-DASHBOARD-NAME}?embed&_g={GLOBAL-STATE-DATA}&_a={APP-STATE-DATA}

@bondib
Copy link
Owner

bondib commented Jul 16, 2018

Closing the issue as this is the same like #2
If there was clear indication of how to use - or a more robust framework of doing so - this won't have arrived.

@bondib bondib closed this as completed Jul 16, 2018
@ameygat
Copy link
Author

ameygat commented Jul 17, 2018

Do you have any example of how to send rison encoded APP-STATE-DATA and GLOBAL-STATE-DATA objects ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants