<?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: Monitoring logifiles for errors hourly in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048787#M543963</link>
    <description>Hi.&lt;BR /&gt;&lt;BR /&gt;Why not make a copy of the log file every hour,  then diff it and search the diff. It will use space but solve the time problem.&lt;BR /&gt;Example:&lt;BR /&gt;diff sample.log sample1.log | grep ^\&amp;lt; | cut -c 2- &amp;gt; search.log&lt;BR /&gt;cp -p sample.log sample1.log&lt;BR /&gt;&lt;BR /&gt;The data will be in search.log&lt;BR /&gt;&lt;BR /&gt;Another solution would be to run a x=`wc -l sample.log` on the log file every hour and when you scan the log file skip the first x lines, however thats a little more work and if the contents of the log files are reset or logrtated you could end up with a problem.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Andrew Y</description>
    <pubDate>Thu, 24 May 2007 02:17:25 GMT</pubDate>
    <dc:creator>Andrew Young_2</dc:creator>
    <dc:date>2007-05-24T02:17:25Z</dc:date>
    <item>
      <title>Monitoring logifiles for errors hourly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048784#M543960</link>
      <description>Is there a way to monitor a log for errors but only for the previous hour? I am running a simple grep statement to search the log for "fatal", but I want it to look at only the previous hours worth of data. So if I was to run the command at 4:00, I would want it to search for errors only created from 3:00 to 3:59. Thanks in advance, Gary</description>
      <pubDate>Wed, 23 May 2007 17:17:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048784#M543960</guid>
      <dc:creator>Gary Friou</dc:creator>
      <dc:date>2007-05-23T17:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring logifiles for errors hourly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048785#M543961</link>
      <description>You'd have to build some "smarts" into your script so that it also checks the time and date in the log file.</description>
      <pubDate>Wed, 23 May 2007 17:51:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048785#M543961</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2007-05-23T17:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring logifiles for errors hourly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048786#M543962</link>
      <description>You could use grep -n and then delete all lines that were there in the previous output, based on the line number.</description>
      <pubDate>Thu, 24 May 2007 00:23:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048786#M543962</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-05-24T00:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring logifiles for errors hourly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048787#M543963</link>
      <description>Hi.&lt;BR /&gt;&lt;BR /&gt;Why not make a copy of the log file every hour,  then diff it and search the diff. It will use space but solve the time problem.&lt;BR /&gt;Example:&lt;BR /&gt;diff sample.log sample1.log | grep ^\&amp;lt; | cut -c 2- &amp;gt; search.log&lt;BR /&gt;cp -p sample.log sample1.log&lt;BR /&gt;&lt;BR /&gt;The data will be in search.log&lt;BR /&gt;&lt;BR /&gt;Another solution would be to run a x=`wc -l sample.log` on the log file every hour and when you scan the log file skip the first x lines, however thats a little more work and if the contents of the log files are reset or logrtated you could end up with a problem.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Andrew Y</description>
      <pubDate>Thu, 24 May 2007 02:17:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048787#M543963</guid>
      <dc:creator>Andrew Young_2</dc:creator>
      <dc:date>2007-05-24T02:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring logifiles for errors hourly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048788#M543964</link>
      <description>Hi Gary,&lt;BR /&gt;please, post an example of your log file so I'll be bale to help you in wrting script based on the line format you have.&lt;BR /&gt;Rgds,&lt;BR /&gt;Art</description>
      <pubDate>Fri, 25 May 2007 02:49:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048788#M543964</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2007-05-25T02:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring logifiles for errors hourly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048789#M543965</link>
      <description>I kind of like Andrew's suggestion above, but maybe with a little bit different theory.&lt;BR /&gt;&lt;BR /&gt;Here's a line of the log I am looking for errors in:&lt;BR /&gt;&lt;BR /&gt;17:03:02|SELA=00:03:00|SUBM=dms@dbmsn01|SNOD=NDM.SPARE|CCOD=16|RECI=PERR|RECC=CAPR|LNOD=P|PNOD=dbmsn01|MSST=Process fatal error&lt;BR /&gt;&lt;BR /&gt;So to go along with Andrew's suggestion, is there a way to maybe grep for every line that begins with the current time and includes lines for the previous 60 minutes, re-direct that to another temporary log and then grep that log for the 'fatal' error condition?&lt;BR /&gt;&lt;BR /&gt;Thanks again all for your assistance...</description>
      <pubDate>Fri, 25 May 2007 10:58:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048789#M543965</guid>
      <dc:creator>Gary Friou</dc:creator>
      <dc:date>2007-05-25T10:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring logifiles for errors hourly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048790#M543966</link>
      <description>To figure the hour you would have to do something like:&lt;BR /&gt;&lt;BR /&gt;HOUR=$(date +%H)&lt;BR /&gt;if (( ${HOUR} == 0 )) ; then&lt;BR /&gt;   PREVHOUR=23&lt;BR /&gt;else&lt;BR /&gt;   let PREVHOUR=${HOUR}-1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Then you can try doing your grep.  You should be able to combine it into something like:&lt;BR /&gt;&lt;BR /&gt;grep ^${PREVHOUR}: filename | grep -i fatal&lt;BR /&gt;&lt;BR /&gt;The ^${PREVHOUR}: will look for the value of previous hour at the beginning of the line with a : after it, like 17:.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 25 May 2007 11:30:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048790#M543966</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2007-05-25T11:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring logifiles for errors hourly</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048791#M543967</link>
      <description>Thanks very much Patrick...&lt;BR /&gt;&lt;BR /&gt;I used the PREVHOUR statement you shared and that solved my issue.&lt;BR /&gt;&lt;BR /&gt;Thanks again to all who responded...</description>
      <pubDate>Fri, 25 May 2007 12:44:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/monitoring-logifiles-for-errors-hourly/m-p/5048791#M543967</guid>
      <dc:creator>Gary Friou</dc:creator>
      <dc:date>2007-05-25T12:44:59Z</dc:date>
    </item>
  </channel>
</rss>

