summarize bytes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bastardx

    summarize bytes

    Hi
    I wonder if you can point me to some scripts because I don't know perl.
    I think that perl is best for what I want to do.
    I have special kind of logs which looks like following:
    ID - is client id
    Date - is server access date
    IN - bytes sent to server
    OUT - bytes received from server

    ID DATE IN OUT
    id12 2005-06-07 12 1091
    id16 2005-06-07 893 17881
    id12 2005-06-07 53 9912
    id34 2005-06-07 323 7211
    id34 2005-06-07 15 2381
    id34 2005-06-07 542 9771
    id16 2005-06-07 90 9912
    id16 2005-06-07 409 6712
    id12 2005-06-07 311 3443
    id34 2005-06-07 342 1123
    id12 2005-06-07 90 7455
    id34 2005-06-07 145 512
    id12 2005-06-07 88 1667

    I want to summarize IN and OUT bytes for particular ID per day
    Fg
    ID DATE TOTAL_IN TOTAL_OUT
    id12 2005-06-07 12314 8098794

    Can you help me?


  • Randal L. Schwartz

    #2
    Re: summarize bytes

    *** post for FREE via your newsreader at post.newsfeed.c om ***
    [color=blue][color=green][color=darkred]
    >>>>> "bastardx" == bastardx <bastardx@S-P-A-Mop.pl> writes:[/color][/color][/color]

    bastardx> Can you help me?

    Yes! Visit http://learn.perl.org, and read the stuff recommended there.

    And STOP POSTING TO COMP.LANG.PERL, which doesn't exist.

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <merlyn@stonehe nge.com> <URL:http://www.stonehenge. com/merlyn/>
    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
    See PerlTraining.St onehenge.com for onsite and open-enrollment Perl training!


    -----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
    http://www.newsfeed.com - The #1 Newsgroup Service in the World!
    -----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----

    Comment

    • bastardx

      #3
      Re: summarize bytes

      > bastardx> Can you help me?[color=blue]
      >
      > Yes! Visit http://learn.perl.org, and read the stuff recommended there.
      >
      > And STOP POSTING TO COMP.LANG.PERL, which doesn't exist.[/color]

      plonk


      Comment

      • Joe Smith

        #4
        Re: summarize bytes

        bastardx wrote:[color=blue]
        > id34 2005-06-07 323 7211
        > id34 2005-06-07 15 2381[/color]

        That's trivial to do using a hash or two in Perl.

        It's the sort of thing found as student exercises
        in early chapters of just about any Perl tutorial.

        Hint:
        $info{$id}{IN} += $in;
        $info{$id}{OUT} += $out;

        -Joe
        Followup-To has been set to comp.lang.perl. misc

        Comment

        • Jürgen Exner

          #5
          Re: summarize bytes

          bastardx wrote:[color=blue][color=green]
          >> bastardx> Can you help me?
          >>
          >> Yes! Visit http://learn.perl.org, and read the stuff recommended
          >> there. And STOP POSTING TO COMP.LANG.PERL, which doesn't exist.[/color]
          >
          > plonk[/color]

          I wonder if you have any idea at all whom you just plonked.....
          Yes, it is *the* Randal L. Schwartz.

          Concidering your past contribution to the Perl community (you did
          contribute, didn't you?) I am quite certain that nobody will follow your
          your public plonk. Rather the other way round.

          jue


          Comment

          • bastardx

            #6
            Re: summarize bytes

            > I wonder if you have any idea at all whom you just plonked.....[color=blue]
            > Yes, it is *the* Randal L. Schwartz.[/color]
            I dont know him and never will, I hope :)
            anyway to be "the Randal L. Schwartz" is no excuse to be rude.
            excuse me "stupid" question if it realy was
            eos
            best regards

            Comment

            • Randal L. Schwartz

              #7
              Re: summarize bytes

              *** post for FREE via your newsreader at post.newsfeed.c om ***
              [color=blue][color=green][color=darkred]
              >>>>> "Jürgen" == Jürgen Exner <jurgenex@hotma il.com> writes:[/color][/color][/color]
              [color=blue][color=green]
              >> plonk[/color][/color]

              Jürgen> I wonder if you have any idea at all whom you just plonked.....

              Besides, plonk'ing an *answerer* is useless. Plonk is a clue for all
              answer-givers to ignore future questions from a given clueless person.

              So, all you end up with is fewer (correct) answers. Your choice. :)

              --
              Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
              <merlyn@stonehe nge.com> <URL:http://www.stonehenge. com/merlyn/>
              Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
              See PerlTraining.St onehenge.com for onsite and open-enrollment Perl training!


              -----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
              http://www.newsfeed.com - The #1 Newsgroup Service in the World!
              -----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----

              Comment

              • thoomas

                #8
                Re: summarize bytes

                Don't be so sure --- I'm with bastardx on this one.


                Comment

                • Jürgen Exner

                  #9
                  Re: summarize bytes

                  thoomas wrote:[color=blue]
                  > Don't be so sure --- I'm with bastardx on this one.[/color]

                  If you would have quoted some context like it has been a proven Usenet
                  custom for over 2 decades then people might actually know what you are
                  agreeing with.

                  jue



                  Comment

                  • thoomas

                    #10
                    Re: summarize bytes

                    Right, and this NG doesn't exist, either.



                    Comment

                    • Jürgen Exner

                      #11
                      Re: summarize bytes

                      thoomas wrote:[color=blue]
                      > Right, and this NG doesn't exist, either.[/color]

                      What are you agreeing with?
                      Would you mind quoting some context such that people have a chance to know
                      what your talking about?

                      jue


                      Comment

                      Working...