SetAuditLogMdResult SetAuditLogMd(AuditLogId tLog, SetAuditLogMdArg tArg)
tLog. Access protocol moniker.
tArg. Operation execution parameters.
The SetAuditLogMd operation sets parameters of access protocol work.
This operation enables the user to set various parameters for filtering records in access protocol. To execute the operation, in the tLog field specify opened workbook instance moniker, and in the tArg field specify work parameters.
The moniker can be obtained on executing the OpenAuditLog operation.
Set filtering parameters in the tArg.meta.filter field, and in the tArg.pattern field set the pattern, according to which the specified parameters are applied. If the filter has been set, the GetAuditLog operation selects records from the non-filtered records list. If the tArg.metaGet field has been defined, the SetAuditLogMd operation results in the list of specified filtering parameters. The specified parameters can also be obtained using the GetAuditLogMd operation.
The example of setting records filter in access protocol. The request contains moniker of the access protocol and required filter parameters. The response contains the full list of filtering settings.
{
"SetAuditLogMd" :
{
"tLog" :
{
"id" : "S1!M!S!A4"
},
"tArg" :
{
"pattern" :
{
"filter" :
{
"conditions" : "Set",
"condition" :
{
"userNames" : "Set",
"stations" : "Set",
"osUsers" : "Set",
"userIPs" : "Set",
"operations" : "Set",
"classes" : "Set",
"objectKeys" : "Set"
}
}
},
"meta" :
{
"filter" :
{
"conditions" :
{
"Item" :
{
"isAnd" : "true",
"isNot" : "false",
"minDate" : "2018-10-01T00:00:00",
"maxDate" : "2018-12-01T00:00:00",
"includeFailedLogons" : "false",
"includeSucceededLogons" : "false",
"includeFailedOperations" : "true",
"includeSucceededOperations" : "true",
"nameFilter" :
{
"isOn" : "true",
"value" : "report",
"caseSensitive" : "false",
"wholeWordsOnly" : "false"
},
"idFilter" :
{
"isOn" : "true",
"value" : "report",
"caseSensitive" : "false",
"wholeWordsOnly" : "false"
}
}
},
"dateOrderAscending" : "true"
}
},
"metaGet" :
{
"filter" :
{
"conditions" : "Get"
}
}
}
}
}
{
"SetAuditLogMdResult" :
{
"metaGet" :
{
"filter" :
{
"conditions" :
{
"Item" :
{
"isAnd" : "1",
"isNot" : "0",
"minDate" : "2018-10-01T00:00:00.000",
"maxDate" : "2018-12-01T00:00:00.000",
"includeFailedLogons" : "0",
"includeSucceededLogons" : "0",
"includeFailedOperations" : "1",
"includeSucceededOperations" : "1",
"nameFilter" :
{
"isOn" : "1",
"value" : "report",
"caseSensitive" : "0",
"wholeWordsOnly" : "0"
},
"idFilter" :
{
"isOn" : "1",
"value" : "report",
"caseSensitive" : "0",
"wholeWordsOnly" : "0"
}
}
},
"dateOrderAscending" : "1",
"top" : "0"
}
}
}
}
public static SetAuditLogMdResult SetAuditLogFilter(string logId, string findText)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var setAuditLog = new SetAuditLogMd()
{
tArg = new SetAuditLogMdArg()
{
meta = new AuditLogMd()
{
filter = new AuditLogFilter()
{
conditions = new AuditLogFilterCondition[1]
{
new AuditLogFilterCondition()
{
isAnd = true,
isNot = false,
minDate = DateTime.Parse("01.10.2018"),
maxDate = DateTime.Parse("01.12.2018"),
includeFailedLogons = false,
includeSucceededLogons = false,
includeFailedOperations = true,
includeSucceededOperations = true,
nameFilter = new StringFilterCondition()
{
caseSensitive = false,
isOn = true,
value = findText,
wholeWordsOnly = false
},
idFilter = new StringFilterCondition()
{
caseSensitive = false,
isOn = true,
value = findText,
wholeWordsOnly = false
}
}
},
dateOrderAscending = true
}
},
pattern = new AuditLogMdPattern()
{
filter = new AuditLogFilterPattern()
{
conditions = ListOperation.Set,
condition = new AuditLogFilterConditionPattern()
{
userNames = ListOperation.Set,
stations = ListOperation.Set,
osUsers = ListOperation.Set,
userIPs = ListOperation.Set,
operations = ListOperation.Set,
classes= ListOperation.Set,
objectKeys= ListOperation.Set
}
},
},
metaGet = new AuditLogMdPattern()
{
filter = new AuditLogFilterPattern()
{
conditions = ListOperation.Get
}
}
},
tLog = new AuditLogId() { id = logId }
};
//Get filtered records from access protocol
var result = somClient.SetAuditLogMd(setAuditLog);
return result;
}
See also: