<?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: Scripting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/3382692#M197860</link>
    <description>Here is something that will do the job. &lt;BR /&gt;&lt;BR /&gt;Note: The script requires perl binary in the system. &lt;BR /&gt;&lt;BR /&gt;typeset -i CUR=0&lt;BR /&gt;CUR=$(/usr/bin/perl -e '{print (time())}')&lt;BR /&gt;&lt;BR /&gt;(( FIFTEEN_MIN_BEFORE = CUR - (15*60) ))&lt;BR /&gt;&lt;BR /&gt;DATE_TO_GREP=$(echo "0D${FIFTEEN_MIN_BEFORE}=Y" | adb | awk '{print $2,$3,$4}' | awk -F: '{print $1":"$2}')&lt;BR /&gt;grep "^${DATE_TO_GREP}" /var/adm/syslog/syslog.log&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 20 Sep 2004 16:17:12 GMT</pubDate>
    <dc:creator>Sundar_7</dc:creator>
    <dc:date>2004-09-20T16:17:12Z</dc:date>
    <item>
      <title>Scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/3382689#M197857</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I need to extract all entries logged for the last 15 Minutes from syslog starting from current time .How can I do it in a shell script.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 20 Sep 2004 15:49:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/3382689#M197857</guid>
      <dc:creator>blal</dc:creator>
      <dc:date>2004-09-20T15:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/3382690#M197858</link>
      <description>Usually a sysadmin type would do a&lt;BR /&gt; &lt;BR /&gt;tail -20 /var/adm/syslog/syslog&lt;BR /&gt; &lt;BR /&gt;to see the last entries.&lt;BR /&gt; &lt;BR /&gt;If you are planning on feeding this into a program, then that me stickier...&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 20 Sep 2004 15:54:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/3382690#M197858</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-09-20T15:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/3382691#M197859</link>
      <description>Hi Rodney,&lt;BR /&gt;&lt;BR /&gt;My requirement is to get entries which are logged in  last 15 Minutes.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Sep 2004 16:00:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/3382691#M197859</guid>
      <dc:creator>blal</dc:creator>
      <dc:date>2004-09-20T16:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/3382692#M197860</link>
      <description>Here is something that will do the job. &lt;BR /&gt;&lt;BR /&gt;Note: The script requires perl binary in the system. &lt;BR /&gt;&lt;BR /&gt;typeset -i CUR=0&lt;BR /&gt;CUR=$(/usr/bin/perl -e '{print (time())}')&lt;BR /&gt;&lt;BR /&gt;(( FIFTEEN_MIN_BEFORE = CUR - (15*60) ))&lt;BR /&gt;&lt;BR /&gt;DATE_TO_GREP=$(echo "0D${FIFTEEN_MIN_BEFORE}=Y" | adb | awk '{print $2,$3,$4}' | awk -F: '{print $1":"$2}')&lt;BR /&gt;grep "^${DATE_TO_GREP}" /var/adm/syslog/syslog.log&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Sep 2004 16:17:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/3382692#M197860</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2004-09-20T16:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/3382693#M197861</link>
      <description>We can do this with shell script as,&lt;BR /&gt;--------------------------------&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;set -x&lt;BR /&gt;&lt;BR /&gt;# Execute with minute &amp;lt; ./script 15&amp;gt;&lt;BR /&gt;IN=${1:-15}&lt;BR /&gt;SYSLOG=/var/adm/syslog/syslog.log&lt;BR /&gt;&lt;BR /&gt;if [[ ! -f $SYSLOG ]]&lt;BR /&gt;then&lt;BR /&gt;  echo "No $SYSLOG file there"&lt;BR /&gt;  exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Day=$(date +'%b %d')&lt;BR /&gt;hour=$(date +"%H")&lt;BR /&gt;min=$(date +"%M")&lt;BR /&gt;&lt;BR /&gt;now=$(echo $hour:$(echo $min | cut -c 1))&lt;BR /&gt;if [[ $min -lt $IN ]]&lt;BR /&gt;then&lt;BR /&gt;  let hh=$hour-1  &lt;BR /&gt;  let mm=60+$min-$IN&lt;BR /&gt;  before=$(echo $hh:$mm)&lt;BR /&gt;else&lt;BR /&gt;  let mm=$min-$IN&lt;BR /&gt;  let hh=$hour&lt;BR /&gt;  before=$(echo $hh:$(echo $mm | cut -c 1))&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;grep "$Day" $SYSLOG | grep -E "${before}[0-9]*|${now}[0-9]*"&lt;BR /&gt;-----------------------------&lt;BR /&gt;&lt;BR /&gt;I have tried to collect the informations on syslog between time frame now and before 15 minutes there ...</description>
      <pubDate>Mon, 20 Sep 2004 23:15:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/3382693#M197861</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-09-20T23:15:35Z</dc:date>
    </item>
  </channel>
</rss>

