Forum Discussion

Brian's avatar
Brian
Icon for Joining the Conversation rankJoining the Conversation
26 days ago

Events Filtering

Good day,

I had been trying to use the catocli to pull events based on destination IP addresses and it only return 1 event, while I can see multiple matching events within the same time frame in CATO portal.

I wonder if anyone had come across similar problem and had found a solution to it

json query

{
    "eventsDimension": [
        {
            "fieldName": "dest_ip"
        }
    ],
    "eventsFilter": [
        {
            "fieldName": "dest_ip",
            "operator": "is",
            "values": "5******8"
        }
    ],
    "eventsMeasure": [
        {
            "aggType": "any",
            "fieldName": "action"
        },
        {
            "aggType": "any",
            "fieldName": "src_ip"
        },
        {
            "aggType": "any",
            "fieldName": "src_port"
        },
        {
            "aggType": "any",
            "fieldName": "subnet_name"
        },
        {
            "aggType": "any",
            "fieldName": "dest_ip"
        },
        {
            "aggType": "any",
            "fieldName": "dest_port"
        }
    ],
    "eventsSort": [
        {
            "fieldName": "action",
            "order": "asc"
        }
    ],
    "timeFrame": "last.P14D"
}

catocli command

catocli query eventsFeed "json input from variable column"

Response

{
    "data": {
        "events": {
            "from": "2025-12-09T09:00:00Z",
            "id": "*******",
            "records": [
                {
                    "fieldsMap": {
                        "action": "Monitor",
                        "dest_ip": "************",
                        "dest_port": "****",
                        "src_ip": "*******",
                        "src_port": "*****",
                        "subnet_name": "**********"
                    },
                    "fieldsUnitTypes": [
                        "none",
                        "none",
                        "none",
                        "none",
                        "none",
                        "none"
                    ],
                    "flatFields": [
                        [
                            "action",
                            "Monitor"
                        ],
                        [
                            "dest_ip",
                            "****************"
                        ],
                        [
                            "dest_port",
                            "************"
                        ],
                        [
                            "src_ip",
                            "**************"
                        ],
                        [
                            "src_port",
                            "***********"
                        ],
                        [
                            "subnet_name",
                            "***************"
                        ]
                    ],
                    "prevTimeFrame": null,
                    "trends": null
                }
            ],
            "to": "2025-12-23T10:00:00Z",
            "total": 1,
            "totals": {
                "action": "********",
                "dest_ip": *****,
                "dest_port": *****,
                "src_ip": "********",
                "src_port": ****,
                "subnet_name": "***********"
            }
        }
    }
}

 


If anyone have any ideas, do kindly share.  Thanks vm.

1 Reply

  • FinnCato's avatar
    FinnCato
    Icon for Cato Professional Services rankCato Professional Services

    The issue occurs because you are passing eventsMeasure.
    eventsMeasure is designed to aggregate the events returned by your query, rather than returning the raw events themselves.
    For example, if you want to know the total number of hits to a specific destination, you would use eventsMeasure with a value like "count" on the destination field.
    If your goal is to retrieve the actual events, do not include eventsMeasure in your query.