-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ys dynatrace event collector #38369
base: master
Are you sure you want to change the base?
Ys dynatrace event collector #38369
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, To be Continued..
Packs/Dynatrace/Integrations/Dynatrace/Dynatrace_description.md
Outdated
Show resolved
Hide resolved
Packs/Dynatrace/Integrations/Dynatrace/Dynatrace_description.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets change the fetch.
field_mapping = { | ||
"Audit logs": ["Audit", "timestamp"], | ||
"APM": ["APM", "startTime"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit hard for future enhancements to change, consider changing it to a pre defined dictionary, we can discuss it further.
events_count = 0 | ||
args = {} | ||
|
||
for i in range(7): # Design says we will do at most five calls every fetch_interval so we can get more events per fetch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is usually not the way we do it but getting a limit and going in loops until we get the amount of events.
|
||
demisto.debug(f"Dynatrace fetch APM {i+1} times in loop. calling query with {args=}") | ||
response = events_query(client, args, "APM") | ||
num_events = len(response.get("events")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after dedup
args["apm_from"] = last_run["last_timestamp"] + 1 | ||
|
||
demisto.debug(f"Dynatrace fetch APM {i+1} times in loop. calling query with {args=}") | ||
response = events_query(client, args, "APM") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response = events_query(client, args, "APM") | |
response = events_query(client, args, "APM") | |
dedup_events = [] |
# If no events were retrieved, we retain the same last_timestamp as before, | ||
# In cases where no events were retrieved and this is the first run (i.e., no last_run_timestamp exists), | ||
# the query will use start_fetch_time again in the next execution. | ||
last_run_to_save["last_timestamp"] = response.get("events")[0]["startTime"] if response["totalCount"] != 0 else (last_run.get("last_timestamp") or fetch_start_time) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider the last timestamp regardless of total count
Contributing to Cortex XSOAR Content
Make sure to register your contribution by filling the contribution registration form
The Pull Request will be reviewed only after the contribution registration form is filled.
Status
Related Issues
fixes: https://jira-dc.paloaltonetworks.com/browse/CIAC-6409
Description
Dynatrace event collector
Must have