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: tools/get_logs.go
+9-6
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,9 @@ import (
13
13
14
14
typeGetLogsHandlerArgsstruct {
15
15
TimeConfig utils.TimeConfig`json:"time_config" jsonschema:"required,description=The time period to get the logs for. e.g. if you want the get the logs for the last 5 minutes you would set time_period=5 and time_window=Minutes. You can also set an absoulute time range by setting start_time and end_time"`
16
-
Filtersmap[string][]string`json:"filters" jsonschema:"description=Log attributes to restrict the search to. Keys are anded together and values in the keys are ORed. e.g. {service.name: [/k8s/test/test /k8s/test/test2] namespace:[test]} will return all logs emited from (service.name = /k8s/test/test OR /k8s/test/test2) AND (namespace = test). Get the possible filter keys from the get_attribute_keys tool and possible values of a filter key from the get_attribute_values tool. If you are looking to get logs of a certain severity you should look up the log_level filter."`
17
-
ExcludeFiltersmap[string][]string`json:"excludeFilters" jsonschema:"description=Log attributes to exclude from the search. Keys are anded together and values in the keys are ORed. e.g. {service.name: [/k8s/test/test /k8s/test/test2] namespace:[test]} will return all logs emited from NOT ((service.name = /k8s/test/test OR /k8s/test/test2) AND (namespace = test)). Get the possible filter keys from the get_attribute_keys tool and possible values of a filter key from the get_attribute_values tool. If you are looking to get logs of a certain severity you should look up the log_level filter."`
18
-
Regexes []string`json:"regexes" jsonschema:"description=Regexes to apply to the log messages. Only the logs with messages that match these regexes will be returned. Regexes are ANDed together. For example if you want to get logs with message that contains the word 'fish' and 'chips' you would set the regexes as ['fish' 'chips']. If you want to OR you should use the | operator in a single regex. regexes only match the body of the log so do not use this to match things like service names. If you want to get error logs use log_level filters instead."`
19
-
ExcludeRegexes []string`json:"excludeRegexes" jsonshcema:"description=Regexes to exclude the log. Log messages that match these regexes will not be returned. Exclude regexes are ORed together. For example if you want to get logs with messages that do not contain the word 'fish' or 'chips' you would set the exclude regexes as ['fish' 'chips']. regexes only match the body of the log so do not use this to match things like service names. If you want to get error logs use log_level filters instead."`
16
+
Filtersmap[string][]string`json:"attributeFilters" jsonschema:"description=You must use get_attribute_keys and get_attribute_values before setting this. Log attributes to restrict the search to. Keys are anded together and values in the keys are ORed. e.g. {service.name: [/k8s/test/test /k8s/test/test2] namespace:[test]} will return all logs emited from (service.name = /k8s/test/test OR /k8s/test/test2) AND (namespace = test). Get the possible filter keys from the get_attribute_keys tool and possible values of a filter key from the get_attribute_values tool. If you are looking to get logs of a certain severity you should look up the log_level filter."`
17
+
ExcludeFiltersmap[string][]string`json:"attributeExcludeFilters" jsonschema:"description=You must use get_attribute_keys and get_attribute_values before setting this.Log attributes to exclude from the search. Keys are anded together and values in the keys are ORed. e.g. {service.name: [/k8s/test/test /k8s/test/test2] namespace:[test]} will return all logs emited from NOT ((service.name = /k8s/test/test OR /k8s/test/test2) AND (namespace = test)). Get the possible filter keys from the get_attribute_keys tool and possible values of a filter key from the get_attribute_values tool. If you are looking to get logs of a certain severity you should look up the log_level filter."`
18
+
Regexstring`json:"regex" jsonschema:"description=Regex to apply to the log search re2 format. Any match in the log message will cause it to be returned. Use the filters parameter log_level if you want to look for logs of a certain severity"`
20
19
Environments []string`json:"environments" jsonschema:"description=The environments to get logs from. If empty logs from all environments will be returned"`
Copy file name to clipboardexpand all lines: tools/tools.go
+3-5
Original file line number
Diff line number
Diff line change
@@ -23,11 +23,9 @@ var MetoroToolsList = []MetoroTools{
23
23
Handler: GetNamespacesHandler,
24
24
},
25
25
{
26
-
Name: "get_logs",
27
-
Description: `Get individual log lines. Results are limited to 100 logs so try to use filters and regexes to narrow down what you are looking for.
28
-
Use this tool when you are interested in the contents of the log lines to get more information to answer why/what.
29
-
If you want to check existence use get_timeseries_data tool with type=logs to get count of logs.`,
30
-
Handler: GetLogsHandler,
26
+
Name: "get_logs",
27
+
Description: `Get logs from all or specific services/hosts/pods. Before calling this you MUST first call get_attribute_keys and get_attribute_values. Results are limited to 100 logs lines. Log lines are large so if you want to check for trends you should use get_timeseries_data with the log type then us this after to drill in. Before using this you MUST first call get_attribute_keys to get the possible log attribute keys which can be used as Filter/ExcludeFilter keys.`,
0 commit comments