Sponsored Content
Top Forums Shell Programming and Scripting awk remote multiple hosts print remote hostname and output Post 303039149 by charli1 on Tuesday 24th of September 2019 09:32:11 AM
Old 09-24-2019
awk remote multiple hosts print remote hostname and output

Hi all,
i'm trying to gether multiple pattern on remote hosts, and trying to print hostname and the pattern,
Code:
ssh remoteserver1 -C 'hostname 2>&1;cat /var/log/server1.log | awk -F ";" '"'"'{ print " "$2" "$5}'"'"'| sort | uniq -c | sort -g -r '

The output is the following,
Code:
 remoteserver1
  5272  3 service Hit with key 
   824  4 service Hit with key
   641  1000 service Hit with key
   264  1000 service Hit with key
    91  1000 service Hit with key
    76  1 service Hit with key
     4  7 service Hit with key
     1  1 service Hit with key

I need to output the following format

Code:
remoteserver1
			5272		3	service Hit with key
			824 		4	service Hit with key
			641		1000	service Hit with key
			264		1000	service Hit with key
			91		1000	service Hit with key
			76		1	service Hit with key
			4		7	service Hit with key
			1		1	service Hit with key

Could you please support on this?
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

ftp into remote hosts

Hi all, Have used ftp to transfer files from remote host to localhost. I was wondering how can I ftp into remote hosts. for example from a unix box, connect to an external server and then ftp that file into mainframe ? I would like to avoid pulling it to unix box and then ftping to mainframe.... (1 Reply)
Discussion started by: kodermanna
1 Replies

2. UNIX for Dummies Questions & Answers

How to Know is a Remote hosts have open port

Hi gurus of unix!!!!, I have a little question. I nedd your helps The scenarios is the following I have tree equipment that are installed in different places. I use a carrier to interconnect the equipment. Some Port's (TCP) need to be open for an application that must be function correctly. For... (3 Replies)
Discussion started by: andresguillen
3 Replies

3. Debian

Launch remote gui apps in remote hosts

Hi, I've been looking for a way to execute a console program (is in windows but by now I accept the linux way) from a linux machine, but this program has to be opened in the remote side. Linux machine acts only as a "signaling" host. My program has to open the camera in the remote side, but only... (7 Replies)
Discussion started by: zauberberg
7 Replies

4. UNIX for Advanced & Expert Users

remote hosts and wide output?

Hello forum: I am curious about some output that I get using an alias <command> on a remote host and I wondered if someone could point me in the right direction. Symptoms: Using "ssh -qi /path/to/key root@som.ipa.ddr.ess mail" (or variation of via alias) only gives a partial textual... (7 Replies)
Discussion started by: Habitual
7 Replies

5. Shell Programming and Scripting

Running a script on multiple remote hosts at once

I have a script on about 15 hosts that I need to run for each host whenever I want (not crontab). Problem is, this script takes 5-10 mins to run for each host. Is there a way I can run the script in parallel for all the hosts instead of 1 at a time? Also, I'm remotely running the script on the... (3 Replies)
Discussion started by: mrskittles99
3 Replies

6. Shell Programming and Scripting

Making output of data from remote hosts smaller

so i'm doing something similar to this: ssh myname@remotehost 'tail -800 /var/log/some.log' Now, as you can see, this is a lot of data to be passing back and forth over a network. Is there anything i can do to make the output smaller (zip it on the fly, compress?) and then when the data... (4 Replies)
Discussion started by: SkySmart
4 Replies

7. Shell Programming and Scripting

Ssh to multiple hosts and then run multiple for loops under remote session

Hello, I am trying to login to multiple servers and i have to run multiple loops to gather some details..Could you please help me out. I am specifically facing issues while running for loops. I have to run multiple for loops in else condition. but the below code is giving errors in for... (2 Replies)
Discussion started by: mohit_vardhani
2 Replies

8. Shell Programming and Scripting

Ssh to validate multiple remote hosts connection validation.

Dear Folks, I am trying to read a config file contains ip and port numbers. i want to read each line of the config file and check ssh connection is happening or not. Kindly guide. Config file: abc@1.2.342 22 abc@1.2.343 22 abc@1.2.344 22 abc@1.2.345 22... (9 Replies)
Discussion started by: sadique.manzar
9 Replies

9. Solaris

How to copy a tar file on a series of remote hosts and untar it on those hosts?

Am trying to copy a tar file onto a series of remote hosts and untar it at the destination. Need to do this without having to do multiple ssh. Actions to perform within a single ssh session via shell script - copy a file - untar at destination (remote host) OS : Linux RHEL6 (3 Replies)
Discussion started by: sankasu
3 Replies

10. Shell Programming and Scripting

Grep remote multiple hosts output to local server

Hello all, i'm trying to create a report by greping a pattern on multiple remote hosts and creta a simple report, actually i did this, is ther any better way to do this. #!/bin/bash for host in `cat RemoteHosts` do ssh $host -C 'hostname 2>&1; grep ERROR /var/log/WebServer.log.2019-09-21... (0 Replies)
Discussion started by: charli1
0 Replies
Bio::Search::Hit::HMMERHit(3pm) 			User Contributed Perl Documentation			   Bio::Search::Hit::HMMERHit(3pm)

NAME
Bio::Search::Hit::HMMERHit - A Hit module for HMMER hits SYNOPSIS
use Bio::Search::Hit::HMMERHit; my $hit = Bio::Search::Hit::HMMERHit->new(); # use it in the same way as Bio::Search::Hit::GenericHit DESCRIPTION
This is a specialization of Bio::Search::Hit::GenericHit. There are a few news methods next_domain and domains. Note that bits and iteration make no sense for this object and will return 0. FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Jason Stajich Email jason@bioperl.org APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new Title : new Usage : my $obj = Bio::Search::Hit::HMMERHit->new(); Function: Builds a new Bio::Search::Hit::HMMERHit object Returns : Bio::Search::Hit::HMMERHit Args : Plus the Bio::Search::Hit::GenericHit inherited params -name => Name of Hit (required) -description => Description (optional) -accession => Accession number (optional) -length => Length of the Hit (optional) -score => Raw Score for the Hit (optional) -significance => Significance value for the Hit (optional) -algorithm => Algorithm used (BLASTP, FASTX, etc...) -hsps => Array ref of HSPs for this Hit. next_domain Title : next_domain Usage : my $domain = $hit->next_domain(); Function: An alias for L<next_hsp()>, this will return the next HSP Returns : L<Bio::Search::HSP::HSPI> object Args : none domains Title : domains Usage : my @domains = $hit->domains(); Function: An alias for L<hsps()>, this will return the full list of hsps Returns : array of L<Bio::Search::HSP::HSPI> objects Args : none inherited Bio::Search::Hit::GenericHit methods add_hsp Title : add_hsp Usage : $hit->add_hsp($hsp) Function: Add a HSP to the collection of HSPs for a Hit Returns : number of HSPs in the Hit Args : Bio::Search::HSP::HSPI object Bio::Search::Hit::HitI methods name Title : name Usage : $hit_name = $hit->name(); Function: returns the name of the Hit sequence Returns : a scalar string Args : [optional] scalar string to set the name accession Title : accession Usage : $acc = $hit->accession(); Function: Retrieve the accession (if available) for the hit Returns : a scalar string (empty string if not set) Args : none description Title : description Usage : $desc = $hit->description(); Function: Retrieve the description for the hit Returns : a scalar string Args : [optional] scalar string to set the descrition length Title : length Usage : my $len = $hit->length Function: Returns the length of the hit Returns : integer Args : [optional] integer to set the length algorithm Title : algorithm Usage : $alg = $hit->algorithm(); Function: Gets the algorithm specification that was used to obtain the hit For BLAST, the algorithm denotes what type of sequence was aligned against what (BLASTN: dna-dna, BLASTP prt-prt, BLASTX translated dna-prt, TBLASTN prt-translated dna, TBLASTX translated dna-translated dna). Returns : a scalar string Args : [optional] scalar string to set the algorithm raw_score Title : raw_score Usage : $score = $hit->raw_score(); Function: Gets the "raw score" generated by the algorithm. What this score is exactly will vary from algorithm to algorithm, returning undef if unavailable. Returns : a scalar value Args : [optional] scalar value to set the raw score significance Title : significance Usage : $significance = $hit->significance(); Function: Used to obtain the E or P value of a hit, i.e. the probability that this particular hit was obtained purely by random chance. If information is not available (nor calculatable from other information sources), return undef. Returns : a scalar value or undef if unavailable Args : [optional] scalar value to set the significance bits Usage : $hit_object->bits(); Purpose : Gets the bit score of the best HSP for the current hit. Example : $bits = $hit_object->bits(); Returns : Integer or undef if bit score is not set Argument : n/a See Also : score() next_hsp Title : next_hsp Usage : while( $hsp = $obj->next_hsp()) { ... } Function : Returns the next available High Scoring Pair Example : Returns : Bio::Search::HSP::HSPI object or null if finished Args : none hsps Usage : $hit_object->hsps(); Purpose : Get a list containing all HSP objects. : Get the numbers of HSPs for the current hit. Example : @hsps = $hit_object->hsps(); : $num = $hit_object->hsps(); # alternatively, use num_hsps() Returns : Array context : list of Bio::Search::HSP::BlastHSP.pm objects. : Scalar context: integer (number of HSPs). : (Equivalent to num_hsps()). Argument : n/a. Relies on wantarray Throws : Exception if the HSPs have not been collected. See Also : hsp(), num_hsps() num_hsps Usage : $hit_object->num_hsps(); Purpose : Get the number of HSPs for the present Blast hit. Example : $nhsps = $hit_object->num_hsps(); Returns : Integer Argument : n/a Throws : Exception if the HSPs have not been collected. See Also : hsps() rewind Title : rewind Usage : $hit->rewind; Function: Allow one to reset the HSP iteration to the beginning Since this is an in-memory implementation Returns : none Args : none iteration Title : iteration Usage : $obj->iteration($newval) Function: PSI-BLAST iteration Returns : value of iteration Args : newvalue (optional) perl v5.14.2 2012-03-02 Bio::Search::Hit::HMMERHit(3pm)
All times are GMT -4. The time now is 03:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy