Comments (12)
@jahidakhtargit Could you please provide the following info:
- Which library did you use?: Ruby, Python, or PHP library?
- Information of your environment on which you use the library (ie, language version, OS & it version etc )
from azure-log-analytics-data-collector.
I am using python 3. In the below code I am getting exception:
utf8_signs = None
try:
utf8_signs = bytes(signs).encode("utf-8")
print("utf8_signs = {}".format(utf8_signs))
except Exception as e:
print("Exception occurred: {}".format(str(e)))
from azure-log-analytics-data-collector.
Thanks! I was able to reproduce the same exception . I'll fix this and get back to you short
from azure-log-analytics-data-collector.
@jahidakhtargit please install new package azure-log-analytics-data-collector-api 0.2.0
pip install azure-log-analytics-data-collector-api --upgrade
from azure-log-analytics-data-collector.
@yokawasa, thanks for the info. Will upgrade and let you know.
from azure-log-analytics-data-collector.
@yokawasa not working, same exception I'm getting
from azure-log-analytics-data-collector.
@yokawasa Exception in the below code, nothing to do with azure here it seems.
signs = "POST\n{}\napplication/json\nx-ms-date:{}\n/api/logs".format(str(content_length), date)
utf8_signs = None
try:
utf8_signs = bytes(signs).encode("utf-8")
print("utf8_signs = {}".format(utf8_signs))
except Exception as e:
print("Exception occurred: {}".format(str(e)))
from azure-log-analytics-data-collector.
@jahidakhtargit Please make sure if you have installed the latest package - azure-log-analytics-data-collector-api-0.2.0
$ pip install azure-log-analytics-data-collector-api --upgrade
$ pip list |grep azure-log-analytics-data-collector-api
azure-log-analytics-data-collector-api 0.2.0
Or if you're directly using source code in Github, please git clone the latest code:
As you can see, the latest __signature function in client.py is like this:
def __signature(self, date, content_length):
sigs= "POST\n{}\napplication/json\nx-ms-date:{}\n/api/logs".format(
str(content_length),date)
utf8_sigs = sigs.encode('utf-8')
decoded_shared_key = base64.b64decode(self.shared_key)
hmac_sha256_sigs = hmac.new(
decoded_shared_key, utf8_sigs,digestmod=hashlib.sha256).digest()
encoded_hash = base64.b64encode(hmac_sha256_sigs).decode('utf-8')
authorization = "SharedKey {}:{}".format(self.customer_id,encoded_hash)
return authorization
Please try with the latest package or source code
from azure-log-analytics-data-collector.
@yokawasa, pulled the latest code. Now it's working. Thanks for the help. One more thing, Custom log is now created in my log analytics workspace, but not able to see any data. How long does it take for the data to appear in azure?
from azure-log-analytics-data-collector.
@jahidakhtargit
There are factors that affect the latency. From my experience, it's somewhere between 5min and 10min. It may be improved in the future but I don't know. The latency I mean here is the time it takes for log data to become available after it's collected.
I'm closing this issue but please feel free to re-open if you have further discussion.
from azure-log-analytics-data-collector.
@yokawasa, is there a way to delete the log created through code in azure?
from azure-log-analytics-data-collector.
@jahidakhtargit
I haven't tried but it seems you can delete the log with Purge API. here are references:
- https://docs.microsoft.com/en-us/azure/azure-monitor/platform/personal-data-mgmt#delete
- https://docs.microsoft.com/en-us/rest/api/loganalytics/workspaces%202015-03-20/purge
from azure-log-analytics-data-collector.
Related Issues (10)
- Log Analytics Data Collector API's response code has changed HOT 1
- Retry function HOT 4
- Testing for invalid characters in log_type HOT 6
- Check body size not to exceed data limits of Azure Monitor Data Collection API HOT 1
- nil response from RestClient causes 'undefined method `code' for nil:NilClass'
- Unable to set/use proxy HOT 3
- read log data from the Azure Log Analytics work space HOT 1
- Fix ruby client: CVE-2020-8130 Moderate severity HOT 1
- Support setting the x-ms-AzureResourceId Header HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-log-analytics-data-collector.