Search Results

Search: Posts Made By: sharingsunshine
Forum: Web Development 07-25-2015
2,076
Posted By sharingsunshine
Htaccess Redirect Problem
Hi,

I have this string that I need to match and redirect to an actual live url.

I have tried what I know and it won't match. This is the url I want to match.
...
7,199
Posted By sharingsunshine
I sure appreciate you letting me know to not...
I sure appreciate you letting me know to not continue down that path for my answer.
7,199
Posted By sharingsunshine
I agree doing it outside of gawk should be much...
I agree doing it outside of gawk should be much faster and easier to implement. However, I am getting less output when I change the code to what you suggested. This would be OK except I used the...
7,199
Posted By sharingsunshine
This is great! Thanks so much for doing that. ...
This is great! Thanks so much for doing that. This will be a great help to me and I am sure it will be a future help to readers also.
7,199
Posted By sharingsunshine
Hi Chubler, I certainly understand when life...
Hi Chubler,

I certainly understand when life situations change our schedules and priorities. Don was able to keep me going in grand fashion. I am just grateful you took the time to write such a...
7,199
Posted By sharingsunshine
This is great, thanks for your help. I also plan...
This is great, thanks for your help. I also plan to find the top 5 entries in each log file during the range of time. So I'll use what you have given me and then figure out how to do that too.
...
7,199
Posted By sharingsunshine
Using this code $5 ~ "-0[45]00]" {I get ...
Using this code
$5 ~ "-0[45]00]" {I get
./modified_gawk.sh "01 Mar 2015" 01:23:47 "02 Jul 2015" 01:55:58
Examining from Sun Mar 1 01:23:47 EST 2015 (1425191027)
to Thu Jul 2...
7,199
Posted By sharingsunshine
this is what I get with the first change ...
this is what I get with the first change
mnum=index("xxJanFebMarAprMayJunJulAugSepOctNovDec", v[3])/3
$1=1.1.1.1
$2=-
$3=-
$4=[02/Jul/2015:01:55:57
$5=-0400]
$6="GET
$7=/content/421-ahmtrust...
7,199
Posted By sharingsunshine
Sorry for my failure to understand what you...
Sorry for my failure to understand what you needed.

./modified_gawk.sh "02 Jul 2015" 01:55:57 01:55:58
Examining from Thu Jul 2 01:55:57 EDT 2015 (1435816557)
to Thu Jul 2...
7,199
Posted By sharingsunshine
Hi Don, It is my fault I didn't catch this...
Hi Don,

It is my fault I didn't catch this phrase
without being overwhelmed with debugging datameant I needed to turn debug=1

now with it set to debug=1 it shows

./modified_gawk.sh "02 Jul...
7,199
Posted By sharingsunshine
Thanks for getting back to me. I put the...
Thanks for getting back to me.

I put the test.log file in /data/log since that is where I have gawk scripts but other than that no other changes and here is the ouput.

./modified_gawk.sh "02...
7,199
Posted By sharingsunshine
Hi Don, Yes, since I can't do a range easily...
Hi Don,

Yes, since I can't do a range easily I picked 01:55 AM on July 2nd. During that time for access_thp.log there are 51 entries.

I won't include them all since I need to change the ip...
7,199
Posted By sharingsunshine
When I run ./gawk.sh "28 May 2015" 09:33:56...
When I run
./gawk.sh "28 May 2015" 09:33:56 09:34:21
Examining from Thu May 28 09:33:56 EDT 2015 (1432820036)
to Thu May 28 09:34:21 EDT 2015 (1432820061)

Processing...
7,199
Posted By sharingsunshine
I changed the test to the same times you...
I changed the test to the same times you specified

./gawk.sh "28 May 2015" 09:33:56 09:34:21and it is still putting this out with debug=1

1432814821 not between 1432820036 and 1432820061...
7,199
Posted By sharingsunshine
Thanks to Don he pointed me in the right...
Thanks to Don he pointed me in the right direction of debug=1

It seems that when I run the script I am getting this output

1432820036 not between 1433169000 and 1433224800
1432820037 not...
7,199
Posted By sharingsunshine
I tried your suggested code change but it still...
I tried your suggested code change but it still isn't producing any output.

Here is the code after the change
$5 == "-0400]" {
split($4,v,"[[/: ]")
...
7,199
Posted By sharingsunshine
Hi Chubler_XL, This looks really good...
Hi Chubler_XL,

This looks really good especially being able to pass the time stamps to the program. However, it seems to only work part way. It is not givng any ip numbers or their counts.
...
7,199
Posted By sharingsunshine
Hi RudiC, I appreciate the code but since...
Hi RudiC,

I appreciate the code but since the file location wildcards aren't specified, I need to know where in your script they should be specified.

I am sure you are correct about the many...
7,199
Posted By sharingsunshine
Hi Don, Thanks for getting back to me. I am...
Hi Don,

Thanks for getting back to me. I am using Centos 6 and Apache as an operating system.

My logs are sorted in increasing time stamp order.

1.1.1.1 - - [01/Jul/2015:10:59:29 -0400]...
7,199
Posted By sharingsunshine
Need Time Stamp Range On Log Files
I have created this script

#!/bin/sh
FILES=/data/log/access_*.log
for f in $FILES
do
echo "Processing $f file"
cat $f | awk '{print $1}' | sort | uniq -c | sort -n | tail
done


It...
12,121
Posted By sharingsunshine
Thanks to all of you for getting me straight on...
Thanks to all of you for getting me straight on cut and showing me what I was doing wrong.

I have been wanting to learn awk. If you know if a good tutorial please shoot me a link.

I'll avoid...
12,121
Posted By sharingsunshine
How To Count Fields For Cut?
I am new to cut and I want to use the field option with a space delimiter on an Apache log file.

For example, if I wanted to find the 200 HTTP code using cut in this manner on the file below

...
Showing results 1 to 22 of 22

 
All times are GMT -4. The time now is 01:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy