Use the script command. If you run the 'script' before running telnet, all the text that is written to the terminal is also written to / file / path / filename. You will need to do "exit" or Ctrl-D to actually write the file, or you can save the file check.
Finally grep in the file using the file name | grep "search text"
/ file / path / filename is the path where you want to save the telnet output.
Using a script command
script /tmp/myscript.txt
then all the commands that you run in the terminal and the output will be in this file. use ctrl + D when you are finished, which will be written to the file.
Make grep in this file.
cat /tmp/myscript.txt | grep "textToSearch"
source share