Questions tagged [python-textfsm]

a template-based state machine for parsing semi-formatted text in Python that is often used to analyze the output of CLI driven devices, such as network routers and switches, but it can be used for any textual output. This tag should not be confused with [fsm].

TextFSM is a template-based finite state machine for parsing semi-formatted text in Python developed at Google Inc.

This tag should be only used for questions specific to TextFSM and not for general or questions that work the same outside of the context of TextFSM. Should not be confused with finite state machine questions as well.

The purpose of TextFSM is to simplify the extraction of semi-structured data out of traditional network devices, such as network routers and switches, but it can be used for any (CLI-driven) textual output.

Basically, an extraction and transformation template, consisting of variables and rules with regular expressions, is applied to text input, e.g. a log file, to produce the desired result.

Further Information:

59 questions
0
votes
1 answer

TextFsm: Cisco NXOS

I have started exploring TextFSM by google, its great for screen scraping. But I'm stuck. Here is the template for the command: vsh_lc -c "show platform internal bcm-usd funcstats" Value Filldown Chassis (.*) Value FUNC (.*) Value COUNT (.*) Value…
0
votes
1 answer

Creating Textfsm Template For Cisco XR // show isis database

I'am trying to create template for show isis database output in Cisco XR, I can't understand what is wrong. Can someone point out? I can not even load template with command of textfsm.TextFSM(template). Template: Value LSPID…
0
votes
1 answer

Python - Textfsm - Fortigate - Parse Name:, Valid from:, Valid to:

Using Textfsm I am attempting to get the output for : Name: Valid from: Valid to: I think the problem is the location in my template to search after == [ Fortinet_CA_SSL ] but would love some help. Output: == [ Fortinet_CA_SSL ] Name: …
0
votes
2 answers

python-textFSM parse multiple line config

I've a task to parse Cisco ACE config. I'm using python textFSM module. This template should parse "serverfarm " part of the config: Value Required Serverfarm_name (\S+) Value load_balance_method (\S+) Value probe_name (\S+) Value List rserver_name…
2001
  • 1
  • 3
0
votes
1 answer

TextFSM nxos template

I have started exploring TextFSM by google, its great for screen scraping. But I'm stuck. Here is the template for the command: "show ip community-list" Value TYPE (Standard|Extended) Value CLNAME (\D+) Value SEQ (\d+) Value ACTION…
netkool
  • 45
  • 1
  • 11
0
votes
1 answer

Use TextFSM to find allowed VLANs on trunk

I'm trying to set up a TextFSM template for NTC ansible which will only pull the Vlans allowed on the trunk from the output of a "show interface trunk" command and can't seem to get what I want. It is giving me all the lines instead of just the…
Netman
  • 179
  • 1
  • 14
0
votes
0 answers

Pyqt4 GUI Not Responding but background process still running

I have a simple program to grab information from switch/router cisco with SSH Connection using Netmiko Library. The program works well, but the program freeze until the process complete. my code: When I press 'generate' button it will call…
Nedy Suprianto
  • 201
  • 1
  • 6
  • 14
0
votes
1 answer

parse cli output 'show proc cpu history' to file csv (Using TextFSM,etc)

Has anyone an idea how to read this table and parse out to CSV file or something. I need to convert it into graph(if possible). I really confused how to read this table, not like 'show inventory' or 'show version' there's have a TextFSM Template to…
Nedy Suprianto
  • 201
  • 1
  • 6
  • 14
0
votes
1 answer

How to combine 2 regular expression in python textfsm?

I have a textfsm python code which parses "ifconfig" command in Linux terminal import textfsm f = open('/home/Projects/test_ra/fsm_cli.txt') inp = f.read() f.close() temp = open('/home/Projects/test_ra/fsm_cli.fsm') tab = textfsm.TextFSM(temp) res…
sans0909
  • 395
  • 7
  • 20
-1
votes
1 answer

Custom TextFSM Template Issue

I'm having issues with a custom TextFSM Template producing errors and I'm not sure what's wrong, because the RegEx works. Here's the sample script: from netmiko import ConnectHandler import Seeker.helpers.constants root =…
Ryan Bell
  • 169
  • 1
  • 8
-1
votes
1 answer

python-textFSM parse multiple line

i have to parse an isis database and i have pb to capture some metrics. My templates is : Value Required LSPID (.*\.\d+\-00) Value OVERLOAD_BIT ([0,1]) Value HOSTNAME (.*) Value IPADD (\d+\.\d+\.\d+\.\d+) Value List CONNECTED_METRIC (\d+) Value List…
finopat
  • 1
  • 1
-1
votes
2 answers

Getting same result on running two commands (Netmiko)

I have the following code to connect to the switch and run two commands and save them as CSV, but the issue is when I run it, it will create two files with a same result! both are the result of "Show Vlan" It's like it replaces the first command.…
HipYThON0
  • 69
  • 7
-1
votes
1 answer

How to parse CLI output with cascading elements using textfsm

I am trying to parse CLI output that has cascading elements using textfsm & python. Here is an example: Ref - https://github.com/google/textfsm/wiki/TextFSM Using this example. How can I get the value of 'CPU utilization' for each Slot ? Routing…
user391
  • 105
  • 1
  • 12
-1
votes
1 answer

Trying to use 'selectattr in' filter with Ansible playbook but it fails as per the playbook below

I am trying to use textfsm to parse the data for admin show platform in that anything with a state of 'IOS XR RUN' 'READY' or 'OK' will pass & anything else will report failed. I'm using the selectattr in option but get the following error - "msg":…
bbann
  • 31
  • 1
  • 3
1 2 3
4