<?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: grep dates on snmp collected data in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138907#M896752</link>
    <description>may be this will help&lt;BR /&gt;&lt;BR /&gt;sed -n '/10\/11\/2002\/15\/11\/2003\/p' &amp;lt; input_file</description>
    <pubDate>Mon, 08 Dec 2003 13:29:19 GMT</pubDate>
    <dc:creator>RAC_1</dc:creator>
    <dc:date>2003-12-08T13:29:19Z</dc:date>
    <item>
      <title>grep dates on snmp collected data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138906#M896751</link>
      <description>Hi people,&lt;BR /&gt;&lt;BR /&gt;I use egrep to grep on data of the format below&lt;BR /&gt;&lt;BR /&gt;10/11/2003 00:00 299 0.43 0.45 140.54 68.34 72.2 32&lt;BR /&gt;11/11/2003 00:05 301 0.25 0.34 93.56 39.77 53.78 28&lt;BR /&gt;12/11/2003 00:10 300 0.34 0.37 113.91 54.08 59.83 32&lt;BR /&gt;&lt;BR /&gt;1) To see all data for just a certain day I usually do &lt;BR /&gt;grep '^10/.*/2003' &lt;SNMP.LOG&gt;&lt;BR /&gt;&lt;BR /&gt;2)to see all data for some days I usually do &lt;BR /&gt;egrep -e '11/.*/2003' -e '12/.*/2003' snmp.log&lt;BR /&gt;&lt;BR /&gt;Now if I want to see the all data for example from 10/11/2003 - 15/11/2003 how would this be done with awk, egrep or sed.&lt;BR /&gt;&lt;BR /&gt;My main aim is to see/filter all data in a snmp log file just for mondays-fridays and omitting all the weekend dates.&lt;BR /&gt;&lt;BR /&gt;Any help or advice will be grately appreciated.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;seun&lt;/SNMP.LOG&gt;</description>
      <pubDate>Mon, 08 Dec 2003 13:17:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138906#M896751</guid>
      <dc:creator>Seun Ewulomi_1</dc:creator>
      <dc:date>2003-12-08T13:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: grep dates on snmp collected data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138907#M896752</link>
      <description>may be this will help&lt;BR /&gt;&lt;BR /&gt;sed -n '/10\/11\/2002\/15\/11\/2003\/p' &amp;lt; input_file</description>
      <pubDate>Mon, 08 Dec 2003 13:29:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138907#M896752</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2003-12-08T13:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: grep dates on snmp collected data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138908#M896753</link>
      <description>If the DAY is always the first column then you can simply do.&lt;BR /&gt;&lt;BR /&gt;grep '^1[1-5]/.*/2003' &lt;SMNP.LOG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Or you can script it with a read statement and input the days you want to grep for... based upon your entry, assigned to a variable.&lt;BR /&gt;&lt;BR /&gt;if i have time i can post a solution like that later.&lt;/SMNP.LOG&gt;</description>
      <pubDate>Mon, 08 Dec 2003 13:29:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138908#M896753</guid>
      <dc:creator>Todd McDaniel_1</dc:creator>
      <dc:date>2003-12-08T13:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: grep dates on snmp collected data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138909#M896754</link>
      <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;Thanks alo for your replies.&lt;BR /&gt;&lt;BR /&gt;Todd - I would really appreciate it if you post a solution of the script that would do this(do it only if you have time). Thanks&lt;BR /&gt;&lt;BR /&gt;Rac - Thanks I will be trying yours and Todds solution in a momment and il reply back.&lt;BR /&gt;&lt;BR /&gt;Thanks guys&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;gab&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Dec 2003 15:34:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138909#M896754</guid>
      <dc:creator>Seun Ewulomi_1</dc:creator>
      <dc:date>2003-12-08T15:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: grep dates on snmp collected data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138910#M896755</link>
      <description>Have you considered using perl? It has date modules available where you could get the day of the week.&lt;BR /&gt; &lt;BR /&gt;use Date::Calc;&lt;BR /&gt;$lower = Date_to_Days(2003,11,10);&lt;BR /&gt;$upper = Date_to_Days(2003,11,15);&lt;BR /&gt;open(INP,"&lt;SNMP.LOG&gt;&lt;/SNMP.LOG&gt;while(&lt;INP&gt;) {&lt;BR /&gt; chomp;&lt;BR /&gt; ($mydate)=split(" ",$_);&lt;BR /&gt; ($day,$mth,$yr)=Decode_Date_EU($mydate);&lt;BR /&gt; $date = Date_to_Days($year,$month,$day);&lt;BR /&gt; $dow=day_of_week($yr,$mth,$day)&lt;BR /&gt; next if $dow &amp;gt;= 6;   # skip SAT,SUN&lt;BR /&gt; next if $date &amp;lt; $lower || $date &amp;gt; $upper;&lt;BR /&gt; print $_,"\n";&lt;BR /&gt;}&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills&lt;/INP&gt;</description>
      <pubDate>Mon, 08 Dec 2003 17:17:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138910#M896755</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-12-08T17:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: grep dates on snmp collected data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138911#M896756</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;her is my solution.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;while read LINE&lt;BR /&gt;do&lt;BR /&gt;  DATE=`echo ${LINE} | cut -c 1-10`&lt;BR /&gt;  DOW=`./timeconv "${LINE}" "%d/%m/%Y"|awk '{printf("%s"),$7}'`&lt;BR /&gt;  if ([[ ${DOW} -gt 0 &amp;amp;&amp;amp; ${DOW} -lt 6 ]])&lt;BR /&gt;  then&lt;BR /&gt;    echo ${LINE}&lt;BR /&gt;  fi&lt;BR /&gt;done &amp;lt; logfile&lt;BR /&gt;&lt;BR /&gt;timeconv.c&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;TIME.H&gt;&lt;BR /&gt;main(argc,arg)&lt;BR /&gt;int argc;&lt;BR /&gt;char **arg;&lt;BR /&gt;{&lt;BR /&gt;  struct tm t;&lt;BR /&gt;  if (argc!=3)&lt;BR /&gt;    {&lt;BR /&gt;      printf("Usage: arg[0] date datefmt(see man strptime)\n");&lt;BR /&gt;      return(2);&lt;BR /&gt;    };&lt;BR /&gt;  strptime(arg[1],arg[2], &amp;amp;t);&lt;BR /&gt;  printf("%2d %2d %2d %2d %2d %1d %3d %1d",t.tm_sec,t.tm_min,t.tm_hour,t.tm_mday&lt;BR /&gt;,t.tm_mon,t.tm_year,t.tm_wday,t.tm_yday,t.tm_isdst);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/TIME.H&gt;&lt;/STDLIB.H&gt;</description>
      <pubDate>Tue, 09 Dec 2003 07:38:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138911#M896756</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-09T07:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: grep dates on snmp collected data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138912#M896757</link>
      <description>Just trying to touch base with ya.&lt;BR /&gt;i am a new HPOV admin. and just saw some answers to some questions i had which you had replied to and ws beneficial.&lt;BR /&gt;&lt;BR /&gt;thinking i might be able to have a mentor in you. touch base with me, geniusaceb_j@msn.com&lt;BR /&gt;&lt;BR /&gt;i am based here in texas USA.&lt;BR /&gt;&lt;BR /&gt;BAYO</description>
      <pubDate>Mon, 19 Jan 2004 12:40:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-dates-on-snmp-collected-data/m-p/3138912#M896757</guid>
      <dc:creator>NocGuy</dc:creator>
      <dc:date>2004-01-19T12:40:43Z</dc:date>
    </item>
  </channel>
</rss>

