Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
I'm a total newbie into Talend 🙂
I'm using tSSH component in order to execute 2 commands on a Linux server, to get the date + the temperature :
"date +\"%Y-%m-%d %T\"; sensors |grep Package"
This gives me this output :
As you can see, the output gives me 2 lines
In order to be able to use this input for powerBI, I would like to get this output into one signle line.
Basically, what I'm willing to get should look like :
2022-06-09 17:29:55 Package id 0: +44.0 .......
Could you please help me to get this reslut? What is the component I need to use?
I've already tried with tNormalise, tDenormalize but did not manage to get what I'm looking for.
Many thanks in advance for your help! 🙂
Kind regards,
Julien
You're a real beast!! 😊
Many thanks again, that worked perfectly with tFilterRow :
I'm now getting the exact result I was looking for, that means :
Perfect!!
Thank you very much again and enjoy your weekend! 😎
Julien
I presume that you are sending the output to the globalMap using the functionality of the component? If so, you can achieve this with some Java String manipulation. The process for doing this will be to let this tSSH component run and connect it to a tJavaFlex using an OnComponentOK link. The tJavaFlex will need the String manipulation code in the Main section.
I am not sure of the exact text that the tSSH is returning as it is in a screenshot. But if you are not familiar with Java String manipulation, get the output sent to the globalMap, print it the screen from the tJavaFlex and then send us the returned text EXACTLY in text format. I will take a look and see what is best.
Thanks for your feedback
This is the exact output that I get on the console :
Démarrage du Job nuc à 19:18 09/06/2022.
[statistics] connecting to socket on port 3939
[statistics] connected
[WARN ] 19:19:00 org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier- Server at /192.168.1.80:22 presented unverified EC key: SHA256:8+S46OmYvVoC26F0T6tOMlOVGbjIBI6jjTq8bXze1Hs
[WARN ] 19:19:01 org.apache.sshd.client.session.ClientConnectionService- globalRequest(ClientConnectionService[ClientSessionImpl[root@/192.168.1.80:22]])[hostkeys-00@openssh.com, want-reply=false] failed (SshException) to process: EdDSA provider not supported
2022-06-09 19:19:01
Package id 0: +45.0�C (high = +100.0�C, crit = +100.0�C)
[statistics] disconnected
Job nuc terminé à 19:19 09/06/2022. [Code de sortie = 0]
****
In fact, what I would like to achieve is :
Insead of :
2022-06-09 19:19:01
Package id 0: +45.0�C (high = +100.0�C, crit = +100.0�C)
I need :
2022-06-09 19:19:01 Package id 0: +45.0�C (high = +100.0�C, crit = +100.0�C)
Or, more generaly, if I use these commands, for an other exemple :
date +\"%Y-%m-%d %T\"; pwd
Instead of getting this (each command on a seperate line) :
2022-06-09 19:21:24
/root
I need the result of the 2 commands on the same line :
2022-06-09 19:21:24 /root
What is the component I need to use to reach that?
Many thanks in advance.
Julien
Hello, qu'est ce que ça donne quand tu mets la sortie en normal ?
Hello
Merci pour la réponse en français 🙂
En fait, ca donne toujours 2 lignes :
Mais cela provient, basiquement, du fait que j'exécute 2 commandes via le tShell
Si j'en exécutais 3 :
J'aurais 3 lignes :
Ce que je voudrais, c'est afficher le résultat de mes N commandes sur 1 seule ligne.
J'ai aussi essayé ça :
Mais le résultat est toujours sur 3 lignes distinctes :
Bonsoir,
Dans ce cas là, essai ainsi
*** Petit test
NB. tu peux personnaliser le séparateur en mettant espace" " à la place de ";" ou autres...
Interesting nickname @not specified not specified 😷
It seems I misinterpreted the requirement here and started a path that wasn't required. Thanks for picking this up and creating the right solution 👍
I'll go ahead in english, to get more poeple able to help, hopefully 😉
Many thanks for help.
The feedback you gave seems to be the right direction.
But for a reason I don't understand, it still doesn't work for me 😔
The result I get is still on multiple lines, instead of being into 1 single line.
Here are some details, if that can help understanding what is not fine :
3 commands executed to Linux host, with tShell, with "normal" output
outputline :
tlogRow_1 :
tDenormalize :
tlogRow_2 :
My aim is to get :
/home/julien; debian11; 9
Insead of getting this (bad) result :
/home/julien
debian11
9
There might be something set incorrectly, but I don't know what....
If you could help me clarifying that, it would be really great!! 😀
Many thanks in advance!
Regards,
Julien
Thank you, 😂 yes I created my account in the middle of the covid19 pandemic👹 , so it was the only idea that came to my mind