Get-LMAuditLog
Syntax
Section titled “Syntax”Range (Default)
Section titled “Range (Default)”Get-LMAuditLog [-SearchString <string>] [-StartDate <datetime>] [-EndDate <datetime>] [-BatchSize <int>] [<CommonParameters>]Get-LMAuditLog [-Id <string>] [-BatchSize <int>] [<CommonParameters>]Filter
Section titled “Filter”Get-LMAuditLog [-Filter <Object>] [-BatchSize <int>] [<CommonParameters>]Description
Section titled “Description”The Get-LMAuditLog function retrieves audit logs from LogicMonitor based on the specified parameters. It supports retrieving logs by ID, by date range, or by applying filters. The function can retrieve up to 10000 logs in a single query.
Examples
Section titled “Examples”EXAMPLE 1
Section titled “EXAMPLE 1”#Retrieve audit logs from the last weekGet-LMAuditLog -StartDate (Get-Date).AddDays(-7)EXAMPLE 2
Section titled “EXAMPLE 2”#Search for specific audit logsGet-LMAuditLog -SearchString "login" -StartDate (Get-Date).AddDays(-30)Parameters
Section titled “Parameters”-BatchSize
Section titled “-BatchSize”The number of results to return per request. Must be between 1 and 1000. Defaults to 1000.
Type: System.Int32DefaultValue: 1000SupportsWildcards: falseAliases: []ParameterSets:- Name: (All) Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-EndDate
Section titled “-EndDate”The end date for retrieving audit logs. Defaults to current time if not specified.
Type: System.DateTimeDefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: Range Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-Filter
Section titled “-Filter”A filter object to apply when retrieving audit logs. Part of a mutually exclusive parameter set.
Type: System.ObjectDefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: Filter Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''The ID of the specific audit log to retrieve. This parameter is part of a mutually exclusive parameter set.
Type: System.StringDefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: Id Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-SearchString
Section titled “-SearchString”A string to filter audit logs by. Only logs containing this string will be returned.
Type: System.StringDefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: Range Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-StartDate
Section titled “-StartDate”The start date for retrieving audit logs. Defaults to 30 days ago if not specified.
Type: System.DateTimeDefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: Range Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''CommonParameters
Section titled “CommonParameters”This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.