2 Replies Latest reply on Feb 11, 2020 4:52 AM by Nirmal Sharma

    Error while executing a rule -- AttributeError: 'list' object has no attribute 'split'

    Nirmal Sharma
      Share This:

      Hi Experts

       

      Please help me with the subjected error in a pattern. IP address is returned by the search statement as list which ideally can be splitted using text.split function. But still pattern generated ECA error.

       

      Code causing the problem.

       

          ip := search(in node traverse Device:ChosenEndpoint:Endpoint:Endpoint show endpoint);

      if ip then

      log.info("IF_IP => %ip%");

      ip_octet_1 := text.split(ip,".")[0];

      ip_octet_2 := text.split(ip,".")[1];

      ip_octet_3 := text.split(ip,".")[2];

      ip_octet_4 := text.split(ip,".")[3];

      ip_octet_12 := "%ip_octet_1%.%ip_octet_2%";

       

      Pattern Execution result.

       

      Last updated at 10-Feb-2020 11:58:57 Download complete log

      nimble10w130m7 (6): 1351ms: IF_IP => ['10.152.148.78'] 
      nimble10w130m7 (6): 1352ms: RuleError on rule tpl_HostLocationSNMPManagedDevice_body_0 due to: Error while executing a rule -- AttributeError: 'list' object has no attribute 'split'

       

      Please help.