64 questions
0
votes
0
answers
47
views
textfsm is also matching \n while matching the \w+ expected [duplicate]
I want to exterect Name and Age through ^(\w+)\n(\d+)$ and it is working.
if I use textfsm Why it is not giving data in correct format?
data:
Alice
37
Smith
41
template:
Value Names (\w+)
Value Ages (...
0
votes
0
answers
49
views
My textfsm template is not parsing the MPLS Interface for a SR 7x50 correctly
I'm hoping somebody can help me figure out the error in my textfsm template.
I need to parse the cli output of the MPLS interface table from a 7x50 SR router and capture all the information, including ...
0
votes
0
answers
174
views
How to handle TextFSM errors when using Netmiko to parse output?
Many NetworkToCode NTC templates have a line such as ^. -> Error (Example). This line means that any line of output which does not match a previous expression results in a TextFSM error action. ...
0
votes
1
answer
66
views
Trying to combine lines using TextFSM
I'm trying to figure out a textfsm parser to process cisco ios object-lists for use with an Ansible playbook task. (Background: There isn't an ios module for object-groups, so I'm trying to do this ...
0
votes
1
answer
127
views
Textfsm parsing Nokia 7750 configuration
I'm trying to parse a Nokia configuration.
Configuration extract:
vpls 1521 name "VPLS_521" customer 1 create
sap lag-50:1923.613 split-horizon-group "SPLIT_HORIZON&...
1
vote
2
answers
135
views
Ansible regex_replace on values of specific keys in a list of dict
I've been struggling with this for a while. I have a list of dict like this which is created by parsing the Cisco CLI output with neighbors_raw.stdout[0] | ansible.netcommon.parse_cli_textfsm('...
0
votes
1
answer
222
views
TextFSM - Parsing Issues
I have some trouble with textFSM, and I don't know if I am doing it right:
So the output that i want to parse is this one:
snmp-server host 10.140.300.200 traps version 2c ldldo-1ldd
snmp-server host ...
0
votes
2
answers
292
views
TEXTFSM Weird Behaviour
I have the following CLI output i need to parse:
Status and Counters - General System Information
System Name : Switch-Name-2
System Contact :
System Location :
MAC Age Time (...
0
votes
1
answer
195
views
TextFSM with repeating regex values?
I am having a difficult time understanding what I thought would be an easy concept. When the output of textFSM has repeating regex values, I am not able to extract the data properly.
Simple example:
...
0
votes
1
answer
108
views
textfsm return repetitive same interface for stackwise link
I am trying to parse value from stackwise link output from Cisco router using textfsm but it seems like the textfsm config file is incorrect because it return the repetitive interface details. Below ...
0
votes
1
answer
123
views
TextFSM template for Cisco ISE version
I'm pretty new to TextFSM and try to parse a "show application version ise" output from a Cisco ISE.
The output looks like:
Cisco Identity Services Engine
------------------------------------...
0
votes
1
answer
128
views
Parsing CISCO's con/aux/vty configuration using TextFSM
I am attempting to parse the configuration of the consoles (con/aux/vty) from a Cisco router using TextFSM, specifically, the output of the command show running-config | partial line. The issue arises ...
1
vote
0
answers
125
views
Match multiple lines in multiple columns textfsm
I am trying to match multiple lines which are present in multiple columns. The text I want to match looks like the following:
vPC domain id : 10
Peer status ...
1
vote
0
answers
155
views
Python using Textfsm it works but not in a function
I'm trying to write a function to parse a traceroute.
It will work if I just have it plain code but not if I put it in a function using a variable. When I put it in a function I get exit code 0 but ...
1
vote
1
answer
489
views
multiple lines into a list of variables
I'm having difficulty with a show license summary template for cisco. It's close, but not quite, and this is my first template so any help is appreciated.
The CLI output is
Smart Licensing is ENABLED
...
1
vote
1
answer
593
views
TextFSm to get convert following text
x y z a b c
------ ----------- ------------------ ------------ --------------- ------------
4000 4000 No ID Hun0/0/12 ...
1
vote
1
answer
730
views
textFSM Collect values into list using the same Value variable
I'm new to textFSM. Trying to use the same value to find and save multiple instances of a value matches across multiple lines of input text. I have tried a number of different constructs but none ...
0
votes
1
answer
817
views
How to parse cisco switch output data with Netmiko
I am doing TDR cable-diagnostics on a Cisco switch and I need to know how to transfer that information to Excel (ordered).
from netmiko import ConnectHandler
#Credenciales
ip = "192.168.xx.xx&...
1
vote
1
answer
230
views
Question with Netmiko and TextFSM against cisco IOSXE
Trying to do a check against Cisco IOSXE to see if any ports are still configured in the default VLAN.
Output = net_connect.send_command ('show int status', use_textfsm=true)
for i in output:
if i[&...
1
vote
1
answer
455
views
Python # Pyinstaller build problem on using Text Fsm
I made a simple program by using Python to access CISCO devices.
I am using the Netmiko Textfsm method for this. When I build an .exe using pyinstaller it works fine.
However, if I copy the .exe to ...
-1
votes
1
answer
2k
views
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....
1
vote
1
answer
1k
views
Using textFSM to parse multiple show commands
I'm trying to use textFSM to compile some Juniper "show" command outputs and get specific fields from them and finally printing collected info in one run.
This is my code:
import textfsm
...
0
votes
1
answer
1k
views
TextFSM - how do I capture lines with blank fields
In the text below, I would like to extract the 3 services. However only the second 2 work, since teh Service Name in the first one is blank.
===========================================================...
1
vote
1
answer
2k
views
Parse output with TextFSM from different sections
I am trying to create a textfsm template for command of a Cisco switch. the command is show platform. This command doesn't have a predefined template in ntc-templates. The CLI command output (Serials ...
0
votes
2
answers
2k
views
Is there a way to record multiple values for a single key with TextFSM?
I'm new to TextFSM and I'm trying to parse a BigIP F5 config using TextFSM. The final results only capturing one profile out of multiple profiles associated with a virtual server. I'm trying to get ...
1
vote
0
answers
240
views
TextFSM: Extracting Data From Different Lines
I am trying to create a TextFSM template to extract data from certain lines in order.
Raw Data
Mod Ports Card Type Model Serial No.
--- ----- -----------------...
-1
votes
1
answer
381
views
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+\.\...
-1
votes
2
answers
213
views
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 "...
0
votes
1
answer
1k
views
Netmiko / textfsm
'Hello, i got my information parsed the way I want it. But now I'm trying to save the output
to a possible .txt file. Im not sure what to type in the "backup.write()" if I type the
"...
0
votes
1
answer
350
views
Parse hierarchical text output with textfsm
I'm having some trouble to parse hierarchical data from an equipment with textfsm.
The data is something similar to that:
pcc-filter-base-name : P2P-BASE
filter = 1337x
filter-state = enabled
flow-...
2
votes
1
answer
718
views
Find a value in a structured file with Ansible
Here I have a small question about how to find a value in a structured file using Ansible. I've seen lineinfile but I'm not pretty sure that it will be helpful. If we assume that my file looks like ...
1
vote
1
answer
2k
views
Optional string in textFSM template
I have a cli output by moxa switch show running-config. Interface section may or may not have a name string.
interface ethernet 1/3
shutdown
name Unused
speed-duplex Auto
no flowcontrol
media ...
1
vote
2
answers
1k
views
Regex, TextFSM - Match content between two characters while excluding unwanted list of strings
Hello Developer Community!
I'm currently working on developing some Ansible playbooks to manage Citrix NetScaler configuration and would like to ask for some help about the following.
I have the ...
0
votes
1
answer
497
views
textfsm return empty value
I am trying to parse value from bgp neighbor output from Cisco router using textfsm but it seems like the textfsm config file is incorrect because it return empty list. Below are sample of textfsm ...
0
votes
2
answers
832
views
single regex using groups that matches either of these lines
I am looking for a single regexp that will match either of these 2 lines, and capture/group the values for speed and duplex.
speed: 1000Mbps (Duplex: full)
speed: n/a
Line #1 should have group 1 with ...
0
votes
0
answers
44
views
Ansible Jinja2 template - catch textfsm exception [duplicate]
I'm using a textfsm filter inside a Jinja2 template to create a report. The textfsm filter can throw an exception, which stops the Jinja2 template from completing.
Below is how I call the textfsm ...
-1
votes
1
answer
602
views
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 ...
2
votes
1
answer
3k
views
Is there a way to Continue with the same line in State changes in TextFSM?
I know that I can't combine state transitions with a continue statement.
I'm trying to parse network configuration with ansible where the only clear end of row its the beginning of the next one.
For ...
0
votes
2
answers
501
views
TextFSM Template for Netmiko for "inc" phrase
I am trying to create a textfsm template with the Netmiko library. While it works for most of the commands, it does not work when I try performing "inc" operation in the network device. The textfsm ...
-1
votes
1
answer
283
views
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 ...
0
votes
1
answer
1k
views
parse_cli_textfsm filter requires TextFSM library to be installed
I'm trying to use Textfsm in a playbook I'm writing.
- name: PLAY1 - Gather Data
hosts: cisco_ios_switches
gather_facts: False
tasks:
- name: Get CDP Facts
ios_command:
...
1
vote
1
answer
4k
views
Netmiko and Textfsm Path and Env Issue Windows
I am currently trying to set up a test with Netmiko and Textfsm in Windows 10, but no matter what path I try to setup the textfsm environment variable, it still doesn't pick it up and throws an error:
...
0
votes
1
answer
212
views
Regex - Match word/letters underneath a specific pattern
Very unusual one but I'm trying to match output from an SSH session that may collapse view and fall underneath the output required (like a collapsed column)...
Take a look at the example output:
...
0
votes
1
answer
773
views
Textfsm template for arp table output
I'm Trying to create a template for the following out. I don't get any matches when run through the textfsm parser but when using a regex tester it seems like it should work.
Value PROTOCOL (\w+)
...
1
vote
2
answers
789
views
Use a captured value as row identifier
I need to parse this raw data in order to process it:
Port Align-Err FCS-Err Xmit-Err Rcv-Err UnderSize OutDiscards
Gi0/1 1 2 3 4 ...
0
votes
1
answer
2k
views
match string from end on TextFSM
Would like match output from end of line to white space
netmgmt@CCC-CC-CCC-RE1> show lldp neighbors
Local Interface Parent Interface Chassis Id Port info System Name
xe-11/3/...
0
votes
1
answer
610
views
How to individually match three separate portions of a single line of CLI output (LLDP) with regex (TextFSM template)
I'm working with Ansible and TextFSM (Python) templates to dynamically pull LLDP info from network devices then to apply the LLDP output to the same devices interface descriptions. I Currently have a ...
3
votes
2
answers
997
views
How to extract comma separated substrings from a string?
Need to parse the algorithms separated by comma in group.
SSH Enabled - version 2.0
Authentication methods:publickey,keyboard-interactive,password
Encryption Algorithms:aes128-ctr,aes192-ctr,aes256-...
4
votes
0
answers
607
views
I want to keep default values in regular expressions if pattern does not match
I want to keep default values in regular expressions if the pattern does not match
Value LINK_GROUP_NAME (\S+)
Start
^ link-group ${LINK_GROUP_NAME}
Above is my python textfsm template. Here if my ...
2
votes
1
answer
5k
views
Is there a way to record multiple lines at once with TextFSM?
I want to parse a Checkpoint Firewall cphaprob -a if executed via Netmiko using TextFSM. The final generated list is not well formatted.
I already tried a lot of TextFSM combination of commands but ...