You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: awswrangler/pandas.py
+35Lines changed: 35 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@
4
4
frommathimportfloor
5
5
importcopy
6
6
importcsv
7
+
fromdatetimeimportdatetime
7
8
8
9
importpandas
9
10
importpyarrow
@@ -833,3 +834,37 @@ def to_redshift(
833
834
mode=mode,
834
835
)
835
836
self._session.s3.delete_objects(path=path)
837
+
838
+
defread_log_query(self,
839
+
query,
840
+
log_group_names,
841
+
start_time=datetime(year=1970, month=1, day=1),
842
+
end_time=datetime.utcnow(),
843
+
limit=None):
844
+
"""
845
+
Run a query against AWS CloudWatchLogs Insights and convert the results to Pandas DataFrame
846
+
847
+
:param query: The query string to use. https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html
848
+
:param log_group_names: The list of log groups to be queried. You can include up to 20 log groups.
849
+
:param start_time: The beginning of the time range to query (datetime.datetime object)
850
+
:param end_time: The end of the time range to query (datetime.datetime object)
851
+
:param limit: The maximum number of log events to return in the query. If the query string uses the fields command, only the specified fields and their values are returned.
0 commit comments