<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Use genie parser on text files in Controllers</title>
    <link>https://community.cisco.com/t5/controllers/use-genie-parser-on-text-files/m-p/5290946#M2872</link>
    <description>&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;pyats.topology &lt;SPAN&gt;import &lt;/SPAN&gt;loader&lt;/PRE&gt;&lt;/DIV&gt;&lt;PRE&gt;tb = loader.&lt;SPAN&gt;load&lt;/SPAN&gt;(&lt;SPAN&gt;"testbed.yaml"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;DIV&gt;&lt;PRE&gt;device = tb.devices[hostname]&lt;BR /&gt;Hostname from your testbed.yaml file&lt;/PRE&gt;&lt;DIV&gt;&lt;PRE&gt;parsed_result = device.parse(command, output=output)&lt;BR /&gt;Where output is the output of the command, a string&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 15 May 2025 09:43:46 GMT</pubDate>
    <dc:creator>aleksej-pojda</dc:creator>
    <dc:date>2025-05-15T09:43:46Z</dc:date>
    <item>
      <title>Use genie parser on text files</title>
      <link>https://community.cisco.com/t5/controllers/use-genie-parser-on-text-files/m-p/4394183#M2438</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there a possibility to use the genie parser on output saved in text files?&lt;/P&gt;&lt;P&gt;The issue is that that it is not possible to install pyATS or genie on the machine where I can access the devices. What I can do is get the output of "show ip interface" save that to a text file and have genie parse that file on my machine.&lt;/P&gt;&lt;P&gt;I could use the NTC TextFSM parser, but wanted to know and learn if it is possible to use genie offline, so to say.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Petrit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 16:29:30 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/use-genie-parser-on-text-files/m-p/4394183#M2438</guid>
      <dc:creator>petritberisha</dc:creator>
      <dc:date>2021-04-27T16:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Use genie parser on text files</title>
      <link>https://community.cisco.com/t5/controllers/use-genie-parser-on-text-files/m-p/4403313#M2439</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;You can use the &lt;A href="https://pypi.org/project/pyats-genie-command-parse/" target="_self"&gt;pyats-genie-command-parse&lt;/A&gt;&amp;nbsp; library as follows&lt;/P&gt;&lt;PRE&gt;from pyats_genie_command_parse import GenieCommandParse


parse_obj = GenieCommandParse(nos='ios')
data = parse_obj.parse_file(show_command='show version', file_name_and_path='./show_version.txt') 
print(data)&lt;/PRE&gt;&lt;P&gt;This is a library to be able to parse NOS command output using the available&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developer.cisco.com/docs/genie-docs/" target="_blank" rel="nofollow noopener"&gt;Genie parsers&lt;/A&gt;, it seperates out needing to create a testbed.yml, and allows you to just get the output, and parse the output with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developer.cisco.com/docs/genie-docs/" target="_blank" rel="nofollow noopener"&gt;Genie parsers&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 21:57:55 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/use-genie-parser-on-text-files/m-p/4403313#M2439</guid>
      <dc:creator>AriBejarano</dc:creator>
      <dc:date>2021-05-14T21:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Use genie parser on text files</title>
      <link>https://community.cisco.com/t5/controllers/use-genie-parser-on-text-files/m-p/4442622#M2440</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using this "pyats_genie_command_parse", seems that some command works some didn't...Eg. are "show interfaces GigabitEthernet2/0/3 counters" or "show authentication sessions interface GigabitEthernet2/0/48 details" (to see NAC session in switchport).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These command always throw an exception. Did I miss something? Seems that those with an interface name have this issue...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ModuleNotFoundError: Could not find module_name for command show interfaces xxx counters for nos iosxe from genie: cli() missing 1 required positional argument: 'interface'&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 02:46:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/use-genie-parser-on-text-files/m-p/4442622#M2440</guid>
      <dc:creator>choywy</dc:creator>
      <dc:date>2021-08-02T02:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Use genie parser on text files</title>
      <link>https://community.cisco.com/t5/controllers/use-genie-parser-on-text-files/m-p/4588903#M2441</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1189673"&gt;@petritberisha&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/285347"&gt;@choywy&lt;/a&gt; Were you able to implement genie offline?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 07:43:49 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/use-genie-parser-on-text-files/m-p/4588903#M2441</guid>
      <dc:creator>alalina</dc:creator>
      <dc:date>2022-04-08T07:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Use genie parser on text files</title>
      <link>https://community.cisco.com/t5/controllers/use-genie-parser-on-text-files/m-p/5290946#M2872</link>
      <description>&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;from &lt;/SPAN&gt;pyats.topology &lt;SPAN&gt;import &lt;/SPAN&gt;loader&lt;/PRE&gt;&lt;/DIV&gt;&lt;PRE&gt;tb = loader.&lt;SPAN&gt;load&lt;/SPAN&gt;(&lt;SPAN&gt;"testbed.yaml"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;DIV&gt;&lt;PRE&gt;device = tb.devices[hostname]&lt;BR /&gt;Hostname from your testbed.yaml file&lt;/PRE&gt;&lt;DIV&gt;&lt;PRE&gt;parsed_result = device.parse(command, output=output)&lt;BR /&gt;Where output is the output of the command, a string&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 15 May 2025 09:43:46 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/use-genie-parser-on-text-files/m-p/5290946#M2872</guid>
      <dc:creator>aleksej-pojda</dc:creator>
      <dc:date>2025-05-15T09:43:46Z</dc:date>
    </item>
  </channel>
</rss>

