Need to find a response time which takes from 1-3 seconds in Apache logsextract last match from logfile till endPrint a line in stdout that matches an expression if the output contains another expressionAWK print regex patternGrep multiple patterns and print a different number of lines below each of the patterns?Grep from the last occurrence of a pattern to another patternHow can I match the date after hitting a pattern match in awk to assure the match is current?Selecting lines in a file that do not contain the value in the other fileFor a large directory, create a variable of the filenames which include lines which include the text string stored in another variableMatching columns of different csv files, not working when column value is different lengthAwk doesn't exit despite “exit 0” command
Are objects structures and/or vice versa?
What does "enim et" mean?
Copycat chess is back
How to answer pointed "are you quitting" questioning when I don't want them to suspect
What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?
I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine
Finding files for which a command fails
Why is the design of haulage companies so “special”?
What happens when a metallic dragon and a chromatic dragon mate?
LWC and complex parameters
Prime joint compound before latex paint?
What is the meaning of "of trouble" in the following sentence?
Is ipsum/ipsa/ipse a third person pronoun, or can it serve other functions?
"My colleague's body is amazing"
How many letters suffice to construct words with no repetition?
What do you call words made from common English words?
Crop image to path created in TikZ?
Eliminate empty elements from a list with a specific pattern
Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?
Is it wise to focus on putting odd beats on left when playing double bass drums?
I see my dog run
Is Fable (1996) connected in any way to the Fable franchise from Lionhead Studios?
Does a dangling wire really electrocute me if I'm standing in water?
How can I add custom success page
Need to find a response time which takes from 1-3 seconds in Apache logs
extract last match from logfile till endPrint a line in stdout that matches an expression if the output contains another expressionAWK print regex patternGrep multiple patterns and print a different number of lines below each of the patterns?Grep from the last occurrence of a pattern to another patternHow can I match the date after hitting a pattern match in awk to assure the match is current?Selecting lines in a file that do not contain the value in the other fileFor a large directory, create a variable of the filenames which include lines which include the text string stored in another variableMatching columns of different csv files, not working when column value is different lengthAwk doesn't exit despite “exit 0” command
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I need to find the API response time from an Apache log file. It's like a response time which is takes between 1 to 2 secound or 2 to 3 second. $6
is response time and values comes in microseconds.
I am trying with following command but the output is always the same:
grep 17/Sep/2016:10 /access.log| awk 'print ($6 > 1000000 && 2000000 > $6)' | wc -l
awk grep
add a comment |
I need to find the API response time from an Apache log file. It's like a response time which is takes between 1 to 2 secound or 2 to 3 second. $6
is response time and values comes in microseconds.
I am trying with following command but the output is always the same:
grep 17/Sep/2016:10 /access.log| awk 'print ($6 > 1000000 && 2000000 > $6)' | wc -l
awk grep
add a comment |
I need to find the API response time from an Apache log file. It's like a response time which is takes between 1 to 2 secound or 2 to 3 second. $6
is response time and values comes in microseconds.
I am trying with following command but the output is always the same:
grep 17/Sep/2016:10 /access.log| awk 'print ($6 > 1000000 && 2000000 > $6)' | wc -l
awk grep
I need to find the API response time from an Apache log file. It's like a response time which is takes between 1 to 2 secound or 2 to 3 second. $6
is response time and values comes in microseconds.
I am trying with following command but the output is always the same:
grep 17/Sep/2016:10 /access.log| awk 'print ($6 > 1000000 && 2000000 > $6)' | wc -l
awk grep
awk grep
edited Sep 18 '16 at 6:13
cutrightjm
2,24121325
2,24121325
asked Sep 18 '16 at 5:33
roshanroshan
84
84
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
This question would be clearer if some lines of access.log
were added as a sample. Anyway, the awk command prints a line regardless of the value of $6
, so when you count the lines with wc -l
you get an outcome that is determined by grep alone.
If you want to count the lines where is $6
is between two different values you can write
grep 17/Sep/2016:10 /access.log | awk '$6 > 1000000 && 2000000 > $6' | wc -l
However, this pipeline is a bit inefficient. It would almost always be preferable to combine it in a single awk command like this:
awk '/17/Sep/2016:10/ && $6 > 1000000 && 2000000 > $6 c++ ENDprint c' access.log
To include the boundaries one can do:
grep 18/Sep/2016:11 /access.log | awk ' $6>=1000000 && $6<=2000000' | wc -l
or equivalently
awk '/18/Sep/2016:11/ && $6>=1000000 && $6<=2000000 c++ ENDprint c' access.log
hey thanks a lot , i want to say one thing i used another coommand which is gave same answer.command is here is it write or not # grep 17/Sep/2016:10 /access.log | awk ' $6>=1000000 && $6<=2000000' | wc -l
– roshan
Sep 18 '16 at 8:47
@roshan: Sure that should also work, if you want to include the boundary values
– user000001
Sep 18 '16 at 9:03
yes its giving same value i checked many times output is same always.
– roshan
Sep 18 '16 at 9:34
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f310606%2fneed-to-find-a-response-time-which-takes-from-1-3-seconds-in-apache-logs%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This question would be clearer if some lines of access.log
were added as a sample. Anyway, the awk command prints a line regardless of the value of $6
, so when you count the lines with wc -l
you get an outcome that is determined by grep alone.
If you want to count the lines where is $6
is between two different values you can write
grep 17/Sep/2016:10 /access.log | awk '$6 > 1000000 && 2000000 > $6' | wc -l
However, this pipeline is a bit inefficient. It would almost always be preferable to combine it in a single awk command like this:
awk '/17/Sep/2016:10/ && $6 > 1000000 && 2000000 > $6 c++ ENDprint c' access.log
To include the boundaries one can do:
grep 18/Sep/2016:11 /access.log | awk ' $6>=1000000 && $6<=2000000' | wc -l
or equivalently
awk '/18/Sep/2016:11/ && $6>=1000000 && $6<=2000000 c++ ENDprint c' access.log
hey thanks a lot , i want to say one thing i used another coommand which is gave same answer.command is here is it write or not # grep 17/Sep/2016:10 /access.log | awk ' $6>=1000000 && $6<=2000000' | wc -l
– roshan
Sep 18 '16 at 8:47
@roshan: Sure that should also work, if you want to include the boundary values
– user000001
Sep 18 '16 at 9:03
yes its giving same value i checked many times output is same always.
– roshan
Sep 18 '16 at 9:34
add a comment |
This question would be clearer if some lines of access.log
were added as a sample. Anyway, the awk command prints a line regardless of the value of $6
, so when you count the lines with wc -l
you get an outcome that is determined by grep alone.
If you want to count the lines where is $6
is between two different values you can write
grep 17/Sep/2016:10 /access.log | awk '$6 > 1000000 && 2000000 > $6' | wc -l
However, this pipeline is a bit inefficient. It would almost always be preferable to combine it in a single awk command like this:
awk '/17/Sep/2016:10/ && $6 > 1000000 && 2000000 > $6 c++ ENDprint c' access.log
To include the boundaries one can do:
grep 18/Sep/2016:11 /access.log | awk ' $6>=1000000 && $6<=2000000' | wc -l
or equivalently
awk '/18/Sep/2016:11/ && $6>=1000000 && $6<=2000000 c++ ENDprint c' access.log
hey thanks a lot , i want to say one thing i used another coommand which is gave same answer.command is here is it write or not # grep 17/Sep/2016:10 /access.log | awk ' $6>=1000000 && $6<=2000000' | wc -l
– roshan
Sep 18 '16 at 8:47
@roshan: Sure that should also work, if you want to include the boundary values
– user000001
Sep 18 '16 at 9:03
yes its giving same value i checked many times output is same always.
– roshan
Sep 18 '16 at 9:34
add a comment |
This question would be clearer if some lines of access.log
were added as a sample. Anyway, the awk command prints a line regardless of the value of $6
, so when you count the lines with wc -l
you get an outcome that is determined by grep alone.
If you want to count the lines where is $6
is between two different values you can write
grep 17/Sep/2016:10 /access.log | awk '$6 > 1000000 && 2000000 > $6' | wc -l
However, this pipeline is a bit inefficient. It would almost always be preferable to combine it in a single awk command like this:
awk '/17/Sep/2016:10/ && $6 > 1000000 && 2000000 > $6 c++ ENDprint c' access.log
To include the boundaries one can do:
grep 18/Sep/2016:11 /access.log | awk ' $6>=1000000 && $6<=2000000' | wc -l
or equivalently
awk '/18/Sep/2016:11/ && $6>=1000000 && $6<=2000000 c++ ENDprint c' access.log
This question would be clearer if some lines of access.log
were added as a sample. Anyway, the awk command prints a line regardless of the value of $6
, so when you count the lines with wc -l
you get an outcome that is determined by grep alone.
If you want to count the lines where is $6
is between two different values you can write
grep 17/Sep/2016:10 /access.log | awk '$6 > 1000000 && 2000000 > $6' | wc -l
However, this pipeline is a bit inefficient. It would almost always be preferable to combine it in a single awk command like this:
awk '/17/Sep/2016:10/ && $6 > 1000000 && 2000000 > $6 c++ ENDprint c' access.log
To include the boundaries one can do:
grep 18/Sep/2016:11 /access.log | awk ' $6>=1000000 && $6<=2000000' | wc -l
or equivalently
awk '/18/Sep/2016:11/ && $6>=1000000 && $6<=2000000 c++ ENDprint c' access.log
edited Sep 18 '16 at 9:05
answered Sep 18 '16 at 6:23
user000001user000001
997714
997714
hey thanks a lot , i want to say one thing i used another coommand which is gave same answer.command is here is it write or not # grep 17/Sep/2016:10 /access.log | awk ' $6>=1000000 && $6<=2000000' | wc -l
– roshan
Sep 18 '16 at 8:47
@roshan: Sure that should also work, if you want to include the boundary values
– user000001
Sep 18 '16 at 9:03
yes its giving same value i checked many times output is same always.
– roshan
Sep 18 '16 at 9:34
add a comment |
hey thanks a lot , i want to say one thing i used another coommand which is gave same answer.command is here is it write or not # grep 17/Sep/2016:10 /access.log | awk ' $6>=1000000 && $6<=2000000' | wc -l
– roshan
Sep 18 '16 at 8:47
@roshan: Sure that should also work, if you want to include the boundary values
– user000001
Sep 18 '16 at 9:03
yes its giving same value i checked many times output is same always.
– roshan
Sep 18 '16 at 9:34
hey thanks a lot , i want to say one thing i used another coommand which is gave same answer.command is here is it write or not # grep 17/Sep/2016:10 /access.log | awk ' $6>=1000000 && $6<=2000000' | wc -l
– roshan
Sep 18 '16 at 8:47
hey thanks a lot , i want to say one thing i used another coommand which is gave same answer.command is here is it write or not # grep 17/Sep/2016:10 /access.log | awk ' $6>=1000000 && $6<=2000000' | wc -l
– roshan
Sep 18 '16 at 8:47
@roshan: Sure that should also work, if you want to include the boundary values
– user000001
Sep 18 '16 at 9:03
@roshan: Sure that should also work, if you want to include the boundary values
– user000001
Sep 18 '16 at 9:03
yes its giving same value i checked many times output is same always.
– roshan
Sep 18 '16 at 9:34
yes its giving same value i checked many times output is same always.
– roshan
Sep 18 '16 at 9:34
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f310606%2fneed-to-find-a-response-time-which-takes-from-1-3-seconds-in-apache-logs%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown