<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script needed... in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254696#M640609</link>
    <description>&amp;gt;parse out (20100613) from a string of line like the following from the log file&lt;BR /&gt;&lt;BR /&gt;What do you mean by "parse out"?  Exclude, select?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;The log file name changes with appname and hostname /port and is of the pattern - /App1-region_prod1-doms-2001.corp_8000&lt;BR /&gt;&lt;BR /&gt;Is the pattern:&lt;BR /&gt;/${FIELD2}_${FIELD1e}_${FIELD4}&lt;BR /&gt;Where $FIELD1e is FIELD1 but without ".zap.com"?</description>
    <pubDate>Wed, 08 Sep 2010 05:00:15 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2010-09-08T05:00:15Z</dc:date>
    <item>
      <title>Script needed...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254695#M640608</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;I have a file which has a list of host, I want to ssh to each of the first box for an app and grep through the logs for version of the application and look for a certain string "Connection is open" in the log file. The file I am refering to looks like this - &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;prod1-doms-2001.corp.zap.com:App1-America:PROD:8000&lt;BR /&gt;prod2-doms-2001.corp.zap.com:App1-Asia:PROD:8020&lt;BR /&gt;prod3-doms-2002.corp.zap.com:App1-Europe:PROD:8040&lt;BR /&gt;prod1-doms-2001.corp.zap.com:App2-America:PROD:9000&lt;BR /&gt;prod2-doms-2001.corp.zap.com:App2-Asia:PROD:9020&lt;BR /&gt;prod3-coms-2002.corp.zap.com:App2-Europe:PROD:9040&lt;BR /&gt;&lt;BR /&gt;where columns are separated by colons - &lt;BR /&gt;&lt;BR /&gt;First column - hostname&lt;BR /&gt;Second column - app name &lt;BR /&gt;Third column - env name&lt;BR /&gt;Forth column  - port #&lt;BR /&gt;&lt;BR /&gt;I want to ssh to first host of each app then grep for a string called "connection is open" and also parse out (20100613) from a string of line like the following from the log file - &lt;BR /&gt;&lt;BR /&gt;.... -JbossRootDirectory=/remote/QB/packages/App1-20100712-133944-249b7220ac454586864a7...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Currently I am doing this manually but since there are some 30 hosts, I want to have this executed from a central admin box.&lt;BR /&gt;&lt;BR /&gt;The log file name changes with appname and hostname /port and is of the pattern -  /App1-region_prod1-doms-2001.corp_8000&lt;BR /&gt;&lt;BR /&gt;Please share if someone has developed a script which can do this. I want to do this after restart of each app.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan</description>
      <pubDate>Wed, 08 Sep 2010 04:19:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254695#M640608</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-09-08T04:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Script needed...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254696#M640609</link>
      <description>&amp;gt;parse out (20100613) from a string of line like the following from the log file&lt;BR /&gt;&lt;BR /&gt;What do you mean by "parse out"?  Exclude, select?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;The log file name changes with appname and hostname /port and is of the pattern - /App1-region_prod1-doms-2001.corp_8000&lt;BR /&gt;&lt;BR /&gt;Is the pattern:&lt;BR /&gt;/${FIELD2}_${FIELD1e}_${FIELD4}&lt;BR /&gt;Where $FIELD1e is FIELD1 but without ".zap.com"?</description>
      <pubDate>Wed, 08 Sep 2010 05:00:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254696#M640609</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-09-08T05:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Script needed...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254697#M640610</link>
      <description>Hi Dennis, &lt;BR /&gt;&lt;BR /&gt;"parse out"? Exclude, select? - I mean select.&lt;BR /&gt;&lt;BR /&gt;Is the pattern:&lt;BR /&gt;/${FIELD2}_${FIELD1e}_${FIELD4}&lt;BR /&gt;Where $FIELD1e is FIELD1 but without ".zap.com"?&lt;BR /&gt;&lt;BR /&gt;Appname-region_&lt;HOSTNAME-WITHOUT-ZAP.COM&gt;_&lt;PORT&gt;&lt;BR /&gt;&lt;BR /&gt;Appname could be App1,App2 etc.&lt;BR /&gt;region could be America,Asia or Europe.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PORT&gt;&lt;/HOSTNAME-WITHOUT-ZAP.COM&gt;</description>
      <pubDate>Wed, 08 Sep 2010 15:20:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254697#M640610</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-09-08T15:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Script needed...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254698#M640611</link>
      <description>&lt;!--!*#--&gt;Hi Allan:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I want to ssh to first host of each app then grep for a string called "connection is open" and also parse out (20100613) from a string of line like the following from the log file - &lt;BR /&gt;&lt;BR /&gt;This isn't a very clear description of what you want.  Are you saying that if you find the string "connection is open" in the log, then and only then do you want to report lines that contain the string "20100613"?&lt;BR /&gt;&lt;BR /&gt;A simple shell script could read you list of hosts and derive the logfile names associated with each host.  This could look like:&lt;BR /&gt;&lt;BR /&gt;# cat ./mklognames&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset INFILE=$1&lt;BR /&gt;OLDIFS=${IFS}&lt;BR /&gt;IFS=":"&lt;BR /&gt;while read HOST APP ENVRN PORT X&lt;BR /&gt;do&lt;BR /&gt;    echo ${APP}_${HOST%%.corp.zap.com}_${PORT}&lt;BR /&gt;done &amp;lt; ${INFILE}&lt;BR /&gt;IFS=${OLDIFS}&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./mklognames ./mklognames.data&lt;BR /&gt;&lt;BR /&gt;...which using your data as input gives:&lt;BR /&gt;&lt;BR /&gt;App1-America_prod1-doms-2001_8000&lt;BR /&gt;App1-Asia_prod2-doms-2001_8020&lt;BR /&gt;App1-Europe_prod3-doms-2002_8040&lt;BR /&gt;App2-America_prod1-doms-2001_9000&lt;BR /&gt;App2-Asia_prod2-doms-2001_9020&lt;BR /&gt;App2-Europe_prod3-coms-2002_9040&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 08 Sep 2010 15:51:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254698#M640611</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-09-08T15:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Script needed...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254699#M640612</link>
      <description>Hi JRF!&lt;BR /&gt;&lt;BR /&gt;20100613 is just an example, it could 20100702.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Are you saying that if you find the string "connection is open" in the log, then and only then do you want to report lines that contain the string "20100613"?&lt;BR /&gt;&lt;BR /&gt;No, we can look for version first before looking for that string - "connection is open".&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
      <pubDate>Wed, 08 Sep 2010 16:02:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254699#M640612</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-09-08T16:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script needed...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254700#M640613</link>
      <description>&lt;!--!*#--&gt;Hi Allan:&lt;BR /&gt;&lt;BR /&gt;OK, as a simplistic shell script you might do:&lt;BR /&gt;&lt;BR /&gt;# cat ./mklognames&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset TOFIND=$1&lt;BR /&gt;typeset INFILE=$2&lt;BR /&gt;OLDIFS=${IFS}&lt;BR /&gt;IFS=":"&lt;BR /&gt;while read HOST APP ENVRN PORT X&lt;BR /&gt;do&lt;BR /&gt;    ssh -n ${HOST} "grep ${TOFIND} ${APP}_${HOST%%.corp.zap.com}_${PORT}"&lt;BR /&gt;done &amp;lt; ${INFILE}&lt;BR /&gt;IFS=${OLDIFS}&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;...run this like:&lt;BR /&gt;&lt;BR /&gt;# ./mklognames 20100702 ./mklognames.data&lt;BR /&gt;&lt;BR /&gt;...where the first argument is the string to match and the second argument is the file of hostnames.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 08 Sep 2010 16:14:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254700#M640613</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-09-08T16:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script needed...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254701#M640614</link>
      <description>Thanks for your script, but as I run it there is one catch here, &lt;BR /&gt;&lt;BR /&gt;Since the list of apps/hosts are too many, I would also like to give appname as an argument so that only the first or all the boxes that belong to that app are searched and not all.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Sep 2010 17:31:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254701#M640614</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-09-08T17:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Script needed...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254702#M640615</link>
      <description>&lt;!--!*#--&gt;Hi (again) Allan:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Since the list of apps/hosts are too many, I would also like to give appname as an argument so that only the first or all the boxes that belong to that app are searched and not all.&lt;BR /&gt;&lt;BR /&gt;Then, perhaps:&lt;BR /&gt;&lt;BR /&gt;# cat ./mklognames&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset TOFIND=$1&lt;BR /&gt;typeset WHATAP=$2&lt;BR /&gt;typeset INFILE=$3&lt;BR /&gt;OLDIFS=${IFS}&lt;BR /&gt;IFS=":"&lt;BR /&gt;while read HOST APP ENVRN PORT X&lt;BR /&gt;do&lt;BR /&gt;    [ $(echo ${APP}|cut -f1 -d"-") != ${WHATAP} ] &amp;amp;&amp;amp; continue&lt;BR /&gt;    ssh -n ${HOST} "grep ${TOFIND} ${APP}_${HOST%%.corp.zap.com}_${PORT}"&lt;BR /&gt;done &amp;lt; ${INFILE}&lt;BR /&gt;IFS=${OLDIFS}&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;...Notice that there are now three arguments.  Run as:&lt;BR /&gt;&lt;BR /&gt;# ./mklognames 20100702 App1 ./mklognames.data&lt;BR /&gt;&lt;BR /&gt;If I understand correctly, the "application" is "App&lt;N&gt;" followed by a hyphen and a "region", hence we snip away the "-" and region suffix.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/N&gt;</description>
      <pubDate>Wed, 08 Sep 2010 17:48:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254702#M640615</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-09-08T17:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Script needed...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254703#M640616</link>
      <description>Hey JRF,&lt;BR /&gt;&lt;BR /&gt;Currently I am not able to search for strings through this script, I tried grep -F but with --color but that did not work and was looking for a single word instead of string.&lt;BR /&gt;&lt;BR /&gt;Can you help?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
      <pubDate>Thu, 09 Sep 2010 21:19:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254703#M640616</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-09-09T21:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Script needed...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254704#M640617</link>
      <description>Hi Allan:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; looking for a single word instead of string.&lt;BR /&gt;&lt;BR /&gt;Try using 'grep -w'.  This matchs whole "words".  See the 'grep' manpages for a full explanation.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 01 Apr 2011 18:39:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254704#M640617</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-04-01T18:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Script needed...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254705#M640618</link>
      <description>Thanks JRF!</description>
      <pubDate>Fri, 01 Apr 2011 19:32:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-needed/m-p/5254705#M640618</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2011-04-01T19:32:40Z</dc:date>
    </item>
  </channel>
</rss>

