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

getlogs.sh problem #278

Closed
staceychan opened this issue Jan 25, 2022 · 2 comments
Closed

getlogs.sh problem #278

staceychan opened this issue Jan 25, 2022 · 2 comments

Comments

@staceychan
Copy link

Hi Expert,

Thanks for giving such a good tool to monitor our viya deployment.
Recently, we want to export our logs to files.
During using "getlogs.sh", we keep getting error even we're pretty sure the host/port/user/passwd is correct cause we can login by the website.

We use ingress host and port as below.
image

Here is the index page of our Elastic.
image

Did we do anything wrong or misunderstand the parameters meanings?
Thanks

Best,
Stacey

@gsmith-sas
Copy link
Member

@staceychan Thank you for reaching out. I just double-checked the documentation and can see that we were not clear about how to set the host and port. In your screenshots, I can see you were using the host and port needed to reach Kibana. The host and port provided to the getlogs.sh script should be the host and port needed to reach Elasticsearch and NOT the host and port needed to reach Kibana. From your screenshots, I can see you are using NodePorts (i.e. port 31033). In that case, you can run the es_nodeport_enable.sh script (found in the logging/bin sub-directory of the repo) to make Elasticsearch available. When the script runs, it will display a URL showing how to access Elasticsearch.

The following console shows how I did this on one of my test clusters:

-bash-4.2$ ./logging/bin/es_nodeport_enable_open.sh
INFO User directory:  /repos/viya4-monitoring-kubernetes
INFO Helm client version: 3.4.1
INFO Kubernetes client version: v1.20.11
INFO Kubernetes server version: v1.20.11
INFO Loading user environment file:  /repos/viya4-monitoring-kubernetes/logging/user.env

service/v4m-es-client-service patched

**Accessing the monitoring applications**

You can access ELASTICSEARCH via the following URL:
https://myserver.foo.com:31775

Note: These URLs may be incorrect if your ingress and/or other network
configuration includes options this script does not handle.


-bash-4.2$ export ESHOST=myserver.foo.com
-bash-4.2$ export ESPORT=31775
-bash-4.2$ export ESUSER=****
-bash-4.2$ export ESPASSWD=****

-bash-4.2$ ./logging/bin/getlogs.sh
INFO User directory:  /repos/viya4-monitoring-kubernetes
INFO Search for matching log messages started... Tue Jan 25 10:32:15 EST 2022
'@timestamp,level,logsource,namespace,pod,container,message
2022-01-25 15:32:14.926,INFO,database,d39984,sas-crunchy-data-postgres-dzgp-5468dc75c8-rzdnw,database,no action. I am a secondary (sas-crunchy-data-postgres-dzgp-5468dc75c8-rzdnw) and following a leader (sas-crunchy-data-postgres-744d4c78ff-c5mnm)

I should also mention that getlogs.sh is still "experimental" and does not always work. This is especially true after our move to the more recent version of Kibana.

You may want to try out the new REPORTING capabilities of Kibana in this new release. This can be accessed by clicking on the link labeled REPORTING in the upper right side of the DISCOVER screen within Kibana. It allows you to generate a CSV from the current set of messages. Please note that you need to be working with a saved search query before the generate CSV option is ungrayed. To do that, add a set of columns to the table and save the view (by selecting SAVE from the menu in the upper-right). Or, use one of the existing saved search queries (either Log Messages or Log Messages (Pods/Containers) which can be loaded by selecting OPEN from that same menu.

IMPORTANT: Please do NOT modify the column layouts of either of these existing search queries; if you do you will break other Kibana content, including some dashboards, that use these search queries.

I hope that helps. Thank you for using our project.

@staceychan
Copy link
Author

staceychan commented Jan 26, 2022

Hi Expert,

Cool. Thanks for your help and it works now.
We also understand the new version kibana can do this task as well.
Appreciate it. :)

Best,
Stacey

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