mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-07 06:34:23 -07:00
Display Log Analytics Ingestion event data as JSON
Previous behavior was to display the data as a Python dictionary. The new behavior makes it easier to generate a sample JSON file in order to import into Azure when creating the table.
This commit is contained in:
parent
1df54c9699
commit
ca43400d93
1 changed files with 4 additions and 1 deletions
|
@ -138,6 +138,7 @@ examples: |
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import getpass
|
import getpass
|
||||||
|
import json
|
||||||
try:
|
try:
|
||||||
import requests
|
import requests
|
||||||
except ImportError as exception:
|
except ImportError as exception:
|
||||||
|
@ -265,8 +266,10 @@ class AzureLogAnalyticsIngestionSource(object):
|
||||||
"Result": result._result,
|
"Result": result._result,
|
||||||
"Session": self.session
|
"Session": self.session
|
||||||
}]
|
}]
|
||||||
|
|
||||||
# Display event data
|
# Display event data
|
||||||
display.vvv(f"Event Data :{str(event_data)}")
|
# The data displayed here can be used as a sample file in order to create the table's schema.
|
||||||
|
display.vvv(f"Event Data: {json.dumps(event_data)}")
|
||||||
|
|
||||||
# Send the event data using the new Logs Ingestion API method
|
# Send the event data using the new Logs Ingestion API method
|
||||||
self.send_event(event_data)
|
self.send_event(event_data)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue