# HTML Log for Execute Command stdout truncated

**URL:** <https://forum.robotframework.org/t/html-log-for-execute-command-stdout-truncated/7728>\
**Category:** SSHLibrary\
**Created:** [22 August 2024 11:45 UTC](https://forum.robotframework.org/t/html-log-for-execute-command-stdout-truncated/7728 "2024-08-22T11:45:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![camilb](https://avatars.discourse-cdn.com/v4/letter/c/c57346/32.png) [@camilb](https://forum.robotframework.org/u/camilb)\
**Post date:** [22 August 2024 11:45 UTC](https://forum.robotframework.org/t/html-log-for-execute-command-stdout-truncated/7728/1 "2024-08-22T11:45:51Z")

</div>

Hi all,

im using Execute Command and run this command on my remote host.

```
${stdout} ${stderr} ${rc} = SSHLibrary . Execute Command ${command} return_stdout=True return_stderr=True return_rc=True

Executing command 'netstat -tulpen | grep -E 'cap|service-ui''

```

Now looking in the html report i see that stdout is truncated - because i see this:

```
03:21:25.795	INFO	Command exited with return code 0.	
03:21:25.795	INFO	${stdout} = tcp 0 0 0.0.0.0:4711 0.0.0.0:* LISTEN      
1200 22314 804/cap         
tcp6 0 0 :::5959 :::* LISTEN ...	
03:21:25.795	INFO	${stderr} = 	
03:21:25.795	INFO	${rc} = 0

```

So there is a programm running on 5959 but i don’t see the name.

This also happens to other commands e.g. if i would execute “netstat -tulpen” without any grep then i will see a list of all listeners on tcp/udp which is a long list - but in stdout the output would also be truncated.

Is there a way how to extend the “stdout” ?

I can see a test in SSHLibrary for Execute command which checks for “huge output” see here line 76:

> <https://github.com/MarketSquare/SSHLibrary/blob/master/atest/execute_command.robot#L76C1-L82C47>

But what would be the stdout for the “cat file.txt” - and would it show the whole file in stdout in the html log?

Br,  
Camil

---

<div class="post-metadata">

**Author:** ![camilb](https://avatars.discourse-cdn.com/v4/letter/c/c57346/32.png) [@camilb](https://forum.robotframework.org/u/camilb)\
**Post date:** [22 August 2024 11:51 UTC](https://forum.robotframework.org/t/html-log-for-execute-command-stdout-truncated/7728/2 "2024-08-22T11:51:30Z")

</div>

Just found this:

> [@Obtain the output with robotframework of SSH session](https://forum.robotframework.org/t/obtain-the-output-with-robotframework-of-ssh-session/6115/5):
>
> Hi Carlos, Sorry I made a mistake (That’s what I get for replying to posts at 1am laughing ) You need return\_rc=True not return\_stderr=True Here’s an example: \*\*\* Test Cases \*\*\* Carlos Pitero 1 Open Connection ${IP} Login ${User} ${Password} ${output} ${rc}= Execute Command ifconfig return\_rc=True Log ${rc} IF ${rc} == 0 Log command has been executed with success ELSE Log command failed with error level ${rc} END Log ${output} Close Connection…

I see that Dave has used “Log” to have the output in the html log.  
So i will try to do the same and will add a variable for stdout and then pass this to “Log”.

Br,  
Camil

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [22 August 2024 12:16 UTC](https://forum.robotframework.org/t/html-log-for-execute-command-stdout-truncated/7728/3 "2024-08-22T12:16:33Z")

</div>

Hi Camil,

Wow I answered your question before I saw it 😉 if only I could perform that trick every time…

Dave.

---

<div class="post-metadata">

**Author:** ![camilb](https://avatars.discourse-cdn.com/v4/letter/c/c57346/32.png) [@camilb](https://forum.robotframework.org/u/camilb)\
**Post date:** [23 August 2024 08:26 UTC](https://forum.robotframework.org/t/html-log-for-execute-command-stdout-truncated/7728/4 "2024-08-23T08:26:01Z")

</div>

Hi Dave,

it’s called the NEW “AI” which even works if you dont explicity ask for it 🙂

Br,  
Camil
