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;








1















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










share|improve this question






























    1















    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










    share|improve this question


























      1












      1








      1








      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










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 18 '16 at 6:13









      cutrightjm

      2,24121325




      2,24121325










      asked Sep 18 '16 at 5:33









      roshanroshan

      84




      84




















          1 Answer
          1






          active

          oldest

          votes


















          0














          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





          share|improve this answer

























          • 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












          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
          );



          );













          draft saved

          draft discarded


















          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









          0














          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





          share|improve this answer

























          • 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
















          0














          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





          share|improve this answer

























          • 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














          0












          0








          0







          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





          share|improve this answer















          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






          share|improve this answer














          share|improve this answer



          share|improve this answer








          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


















          • 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


















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

          Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

          Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.