Thank you very much. I am able to figure this out now.
However can you please let me know if there is anything i missed below. My only goal is to list only rules that has not been used after the "to-date" including rule that never used.
With the below code if I change the "to-date" and run to test if that works, i am getting same rule with different "to-date" value. Which seems not actual. Ran the command with "show-access-rulebase" API call.
# Input with "to-date" : "2018-04-06"
#####################################
{
"offset" : 0,
"limit" : 500,
"name" : "my Security",
"details-level" : "standard",
"show-hits" : true,
"use-object-dictionary" : false,
"hits-settings" : {
"from-date" : "2000-01-01",
"to-date" : "2018-04-06"
}
}
# Output with "to-date" : "2018-04-06"
######################################
"rule-number": 1,
"hits": {
"percentage": "1%",
"level": "low",
"value": 38032181,
"first-date": {
"posix": 1473045718000,
"iso-8601": "2016-09-04T22:21-0500"
},
"last-date": {
"posix": 1523003466000,
"iso-8601": "2018-04-06T03:31-0500"
}
},
# Input with "to-date" : "2017-08-06"
#####################################
{
"offset" : 0,
"limit" : 500,
"name" : "my Security",
"details-level" : "standard",
"show-hits" : true,
"use-object-dictionary" : false,
"hits-settings" : {
"from-date" : "2000-01-01",
"to-date" : "2017-08-06"
}
}
# Output with "to-date" : "2017-08-06"
######################################
"rule-number": 1,
"hits": {
"percentage": "0%",
"level": "low",
"value": 31325295,
"first-date": {
"posix": 1473045718000,
"iso-8601": "2016-09-04T22:21-0500"
},
"last-date": {
"posix": 1502012563000,
"iso-8601": "2017-08-06T04:42-0500"
}
},
However with "show-access-rule" API if i try to fetch data for the rule#1 i get different output as below.
# Input
#########
{
"rule-number": 1,
"layer" : "my Security",
"show-hits" : true
}
# Output
#########
"hits": {
"percentage": "1%",
"level": "low",
"value": 62724501,
"first-date": {
"posix": 1473045718000,
"iso-8601": "2016-09-04T22:21-0500"
},
"last-date": {
"posix": 1538583391000,
"iso-8601": "2018-10-03T11:16-0500"
}
},