Skip to content

difficulty filtering connections #126

Description

@eduardofsj

Hello, I have a tough question and I’m new to MikroTik. I want to get connection data for a specific IP, and I don’t want it to return all the data because the response would be too large and take too long. So, I would like to request only the information I need. I’m trying it this way:

$query = (new Query('/ip/firewall/connection/print')) ->where('dst-address', '192.168.1.200') ->operations('|');

It returns more connections than I want, but on the router, if I perform this search here, it works correctly and gives me the right result.

/ip/firewall/connection/print where dst-address~"192.168.1.200"

How do I make the API request to get the correct connections? I’m really struggling with this. I read through the MikroTik API documentation, but I still found it a bit confusing. Since you have more experience, maybe you can help me.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

questionFurther information is requested

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions