getting log from cloudwatch of aws

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
tyyi
Posts: 84
Joined: 23 Dec 2015, 08:51

getting log from cloudwatch of aws

22 Jun 2018, 23:55

Dear, All

For a long time, I have been worrying about this question.
I think it is not an usual, actually very unusual case.

---------------------------------

I hope to save a log data to my desktop from CloudWatch of AWS in real time

To get it, the site needs to login.
I did try to login using COM & IE but I couldn't.

Code: Select all

	
	wb.document.getElementById("account").value := "1234567890"
	wb.document.getElementById("username").value := "myname"
	wb.document.getElementById("password").value := "mypassword"
	Sleep, 2000
	wb.document.getElementById("signin_button").click()
Most cases in different sites, I can login with above code, but AWS didn't allow.
I didn't know why.

Do you have any idea to save the log data from cloudwatch every 5 minutes?

----------------------

Closing a login browser, the run it, the login status was still available,
so I tried to get the data using UrlDownloadToFile or WinHttp, but it was not working.

Code: Select all

whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.Open("GET", "https://ap-northeast-2.console.aws.amazon.com/cloudwatch/home?region=ap-northeast-2#logEventViewer:group=/var/log/company/www/access.log;stream=www;filter=goole.com;start=PT1H", true)
whr.Send()
whr.WaitForResponse()
result := whr.ResponseText
MsgBox % result
FileAppend, %result%, result.html
I know it is very idiot question, but just hope to hear your voices.

Thank you as always.
gregster
Posts: 9001
Joined: 30 Sep 2013, 06:48

Re: getting log from cloudwatch of aws

23 Jun 2018, 00:08

I bet they have an API interface for this - that would certainly be the right way to go... if available.
Let's see... https://docs.aws.amazon.com/AmazonCloud ... lcome.html
tyyi
Posts: 84
Joined: 23 Dec 2015, 08:51

Re: getting log from cloudwatch of aws

23 Jun 2018, 00:16

Thank you, gregster for your answer.
Before asking a question, I just visit the API page you also shared.
I'm not a developer, I'm still beginner even I knew AHK 3 years ago.
So using API, I didn't consider.

Is it possible to use API on AHK?

Thank you again!
gregster wrote:I bet they have an API interface for this - that would certainly be the right way to go... if available.
Let's see... https://docs.aws.amazon.com/AmazonCloud ... lcome.html
gregster
Posts: 9001
Joined: 30 Sep 2013, 06:48

Re: getting log from cloudwatch of aws

23 Jun 2018, 00:49

Yeah, it should be possible, but it might not be beginner stuff. The Http-Post request itself seems manageable (https://docs.aws.amazon.com/AmazonCloud ... uests.html), but one would have to investigate what this "Signature Version 4 Signing Process" is and how it works.

I agree, your approach is probably easier, if it works... but without having access to the site itself and its html source code, I am not sure what to recommend. Perhaps someone from the forum has some idea and/or access and can quickly help you.
tyyi
Posts: 84
Joined: 23 Dec 2015, 08:51

Re: getting log from cloudwatch of aws

23 Jun 2018, 03:17

Thank you for your kindness.
I really appreciate your reply, also I will see docs you suggested.

Thank you!!!

gregster wrote:Yeah, it should be possible, but it might not be beginner stuff. The Http-Post request itself seems manageable (https://docs.aws.amazon.com/AmazonCloud ... uests.html), but one would have to investigate what this "Signature Version 4 Signing Process" is and how it works.

I agree, your approach is probably easier, if it works... but without having access to the site itself and its html source code, I am not sure what to recommend. Perhaps someone from the forum has some idea and/or access and can quickly help you.
tyyi
Posts: 84
Joined: 23 Dec 2015, 08:51

Re: getting log from cloudwatch of aws

23 Jun 2018, 04:17

I'm still waiting for teaching or ideas from others. :D

My final goal is that getting a log data from CloudWatch in real time, actually every 5 mins, then analyzing log data to show it on my desktop thru MsgBox to know visitors who are from search engine with which keywords.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Holarctic, ishida20, jameswrightesq, Lem2001 and 404 guests