3 Replies Latest reply on Jun 19, 2020 10:07 AM by Bob Anderson

    Search ipadress

    BERNARD Laurent
      Share This:

      I have a large ip list where I would like to have information (more than 1000)

      How can I search any of this list?

      I did :

      search IPAddress where name has subword 'XX.XXX.XXX.X'
      or name has subword 'XX.YYY.YYY.Y'
      ....

       

      But it doesn't work on too many ip

        • 1. Re: Search ipadress
          Danny Fleer

          You could so something like this:

           

          Search IPAddress where ip_addr in ['10.10.10.10', '10.10.10.11']

           

          and so on. I know that there is a limit of the query length, but I don't know the value. You will be notified with a message like "query is too complex" if you exceed the maximum query length.

          • 2. Re: Search ipadress
            Nirmal Sharma

            Does anyone has any idea on the length of query? This becomes important before forming a query to execute.

            • 3. Re: Search ipadress
              Bob Anderson

              Nirmal,

               

              I've done searches like this with as many as 32,600 IPs and it works fine, but takes a while:

               

              I use this format as it is easier to re-use the query simply by replacing the list between the open and close square brackets

               

              //search large list of IPs

              search flags(no_segment) IPAddress where ip_addr in

              [

              '1.1.1.1'

              //.\

              //. )= put in your own list of comma separated, quoted list of IPs

              //./

              '255.255.255.255'

              ]

              //since I don't know the kind of device, I wildcard the traversal

              traverse IPv4Address:DeviceAddress:DeviceWithAddress:

              show

              //use kind(#) to show the device kind (Host, Printer, etc) for additional filtering

              kind(#),

              name,

              os

              //other attributes as needed

              #:ChosenEndpoint::.endpoint