Omega Owners Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Search the maintenance guides for answers to 99.999% of Omega questions

Pages: [1] 2  All   Go Down

Author Topic: My unix awk commands have escaped me! :(  (Read 2364 times)

0 Members and 1 Guest are viewing this topic.

tunnie

  • Get A Life!!
  • *****
  • Offline Offline
  • Gender: Male
  • Surrey
  • Posts: 37573
    • Zafira Tourer & BMW 435i
    • View Profile
My unix awk commands have escaped me! :(
« on: 25 April 2013, 18:18:18 »

I used to be fairly good with Unix Awk/Grep sort commands, but I'm doing some now for the first time in about 4 years and I can remember sod all!  :-[ :-[ :-[  :'( :'(

(btw I'm using Cygwin)

I've got a standard Apache log file, that I'm working from, in which I can successfully awk and sort, eg:

$ awk '{print $7}' ManU\ GameBShort.log | sort -u

From the apache log that gives me lots of rows like this, but with all kinds of usernames and other images ect:

users/tunnie/channels/1301/streams/14157378
users/tunnie/channels/1301/streams
users/tunnie/streams/delete

I removed a lot of custom directories and the username from example above, can't really post that! But in essence I only want to grep unique rows with unique username (tunnie) and "/1301/streams"

So all I want as a result of my command is a list of:

users/user1/channels/1301/streams
users/user2/channels/1301/streams
users/user3/channels/1301/streams
users/user4/channels/1301/streams

And drop all the other junk, but I'm flagging on how I can do this.  :(

Help!

Logged

cem_devecioglu

  • Guest
Re: My unix awk commands have escaped me! :(
« Reply #1 on: 25 April 2013, 18:24:04 »

Tunnie its been nearly 20 years since I left unix..
 
but here is a short way: list the directories and re-direct it to a text file..
 
copy the file to windows and using sql import and export manager load them in sql server
 
then select distinct field name from table where field like '%Tunnie%parameter'  ;D :y
« Last Edit: 25 April 2013, 18:28:44 by cem »
Logged

tunnie

  • Get A Life!!
  • *****
  • Offline Offline
  • Gender: Male
  • Surrey
  • Posts: 37573
    • Zafira Tourer & BMW 435i
    • View Profile
Re: My unix awk commands have escaped me! :(
« Reply #2 on: 25 April 2013, 18:28:33 »

well that is one way, yeah pipe it into a text file. But my SQL is just about as good as my Unix.

Got less and less techy in my current position, its set to be even less soon  :(
Logged

cem_devecioglu

  • Guest
Re: My unix awk commands have escaped me! :(
« Reply #3 on: 25 April 2013, 18:31:30 »

or something like this
find . -exec grep -H "something" {} \;
Logged

tunnie

  • Get A Life!!
  • *****
  • Offline Offline
  • Gender: Male
  • Surrey
  • Posts: 37573
    • Zafira Tourer & BMW 435i
    • View Profile
Re: My unix awk commands have escaped me! :(
« Reply #4 on: 25 April 2013, 18:37:40 »

that would still leave me in same position, it would work for single username i think, but i want all users, but unique requests  :-\
Logged

cem_devecioglu

  • Guest
Re: My unix awk commands have escaped me! :(
« Reply #5 on: 25 April 2013, 18:40:33 »

that would still leave me in same position, it would work for single username i think, but i want all users, but unique requests  :-\

really cant remember  :-\ 
 
I need to read several documents again to solve your problem :-\  too tired sorry :y
Logged

cem_devecioglu

  • Guest
Re: My unix awk commands have escaped me! :(
« Reply #6 on: 25 April 2013, 18:42:23 »

or pipe it to a text file and write a small vb or javascript whatever :-\
Logged

tunnie

  • Get A Life!!
  • *****
  • Offline Offline
  • Gender: Male
  • Surrey
  • Posts: 37573
    • Zafira Tourer & BMW 435i
    • View Profile
Re: My unix awk commands have escaped me! :(
« Reply #7 on: 25 April 2013, 18:44:35 »

or wait until my unix buddies are in tomorrow morning, which is looking increasingly like best option  ;D ;D
Logged

cem_devecioglu

  • Guest
Re: My unix awk commands have escaped me! :(
« Reply #8 on: 25 April 2013, 18:50:36 »

or wait until my unix buddies are in tomorrow morning, which is looking increasingly like best option  ;D ;D

yep :) :y
Logged

dbug

  • Omega Queen
  • *****
  • Offline Offline
  • Gender: Male
  • Northants
  • Posts: 14279
  • Dont knock Linux!
    • Jaguar XJ 5.0V8 Portfolio
    • View Profile
    • Dbug IT Services
Re: My unix awk commands have escaped me! :(
« Reply #9 on: 25 April 2013, 21:35:27 »

Should be easy Tunnie, but like cem, my unix is 20+ years old.  Like cem I'd pipe it into a text file and sort from there ;)
Logged
1972 Ferrari Dino, 1967 Triumph TR4A, Mondeo 2.0TDCi Estate, Jaguar XJ 5.0V8 Portfolio

cem_devecioglu

  • Guest
Re: My unix awk commands have escaped me! :(
« Reply #10 on: 25 April 2013, 21:37:42 »

Should be easy Tunnie, but like cem, my unix is 20+ years old.  Like cem I'd pipe it into a text file and sort from there ;)

 :) :y
Logged

Andy B

  • Get A Life!!
  • *****
  • Offline Offline
  • Gender: Male
  • Bury Lancs
  • Posts: 39778
    • ML350 TDM SmartRoadster
    • View Profile
Re: My unix awk commands have escaped me! :(
« Reply #11 on: 25 April 2013, 21:54:45 »

WTF is the question?  ??? ??? ??? ???
Logged

Vamps

  • Offline Offline
  • Gender: Male
  • Bishop Middleham, Co Durham.
  • Posts: 24708
  • Flying Tonight, so Be Prepared.
    • Mig 2.6CDX and 2.2 Honda
    • View Profile
Re: My unix awk commands have escaped me! :(
« Reply #12 on: 25 April 2013, 22:28:35 »

WTF is the question?  ??? ??? ??? ???

Never mind the question, read the replies...... :o :o  I have absolutely no idea what they are talking about..........and I pressed the translate button..... ::) ::) :D
Logged

Andy B

  • Get A Life!!
  • *****
  • Offline Offline
  • Gender: Male
  • Bury Lancs
  • Posts: 39778
    • ML350 TDM SmartRoadster
    • View Profile
Re: My unix awk commands have escaped me! :(
« Reply #13 on: 25 April 2013, 22:30:52 »

WTF is the question?  ??? ??? ??? ???

Never mind the question, read the replies...... :o :o  I have absolutely no idea what they are talking about..........and I pressed the translate button..... ::) ::) :D

Likewise ............  ::) ::) ;D ;D
Logged

tunnie

  • Get A Life!!
  • *****
  • Offline Offline
  • Gender: Male
  • Surrey
  • Posts: 37573
    • Zafira Tourer & BMW 435i
    • View Profile
Re: My unix awk commands have escaped me! :(
« Reply #14 on: 25 April 2013, 22:48:09 »

Should be easy Tunnie, but like cem, my unix is 20+ years old.  Like cem I'd pipe it into a text file and sort from there ;)

Should be easy, embarrassed asking unix guys in the morning really  :-[
Logged
Pages: [1] 2  All   Go Up
 

Page created in 0.01 seconds with 16 queries.