Extract lines containing certain value or greater
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I am working with a log file that contains entries that appear like this:
$Hostname1: 0x7FDBF4B1AB10 ( 23698) waiting 100 seconds, NSDThread: for I/O completion on disk vd4
$Hostname2: 0x7F2D10A2F8C0 ( 25393) waiting 200 seconds, NSDThread: for I/O completion on disk vd35
$Hostname3: 0x7F2D109F4290 ( 25343) waiting 900 seconds, NSDThread: for I/O completion on disk vd11
$Hostname4: 0x7FDBF4B1AB30 ( 23698) waiting 100 seconds, NSDThread: for I/O completion on disk vd40
$Hostname5: 0x7F2D10A2F830 ( 25392) waiting 750 seconds, NSDThread: for I/O completion on disk vd13
$Hostname6: 0x7F2D109F4240 ( 25342) waiting 500 seconds, NSDThread: for I/O completion on disk vd14
I would like to filter the lines where the wait time is greater than an arbitrary value (let's say 600 seconds). What's the best way to do this in bash?
bash
add a comment |Â
up vote
1
down vote
favorite
I am working with a log file that contains entries that appear like this:
$Hostname1: 0x7FDBF4B1AB10 ( 23698) waiting 100 seconds, NSDThread: for I/O completion on disk vd4
$Hostname2: 0x7F2D10A2F8C0 ( 25393) waiting 200 seconds, NSDThread: for I/O completion on disk vd35
$Hostname3: 0x7F2D109F4290 ( 25343) waiting 900 seconds, NSDThread: for I/O completion on disk vd11
$Hostname4: 0x7FDBF4B1AB30 ( 23698) waiting 100 seconds, NSDThread: for I/O completion on disk vd40
$Hostname5: 0x7F2D10A2F830 ( 25392) waiting 750 seconds, NSDThread: for I/O completion on disk vd13
$Hostname6: 0x7F2D109F4240 ( 25342) waiting 500 seconds, NSDThread: for I/O completion on disk vd14
I would like to filter the lines where the wait time is greater than an arbitrary value (let's say 600 seconds). What's the best way to do this in bash?
bash
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am working with a log file that contains entries that appear like this:
$Hostname1: 0x7FDBF4B1AB10 ( 23698) waiting 100 seconds, NSDThread: for I/O completion on disk vd4
$Hostname2: 0x7F2D10A2F8C0 ( 25393) waiting 200 seconds, NSDThread: for I/O completion on disk vd35
$Hostname3: 0x7F2D109F4290 ( 25343) waiting 900 seconds, NSDThread: for I/O completion on disk vd11
$Hostname4: 0x7FDBF4B1AB30 ( 23698) waiting 100 seconds, NSDThread: for I/O completion on disk vd40
$Hostname5: 0x7F2D10A2F830 ( 25392) waiting 750 seconds, NSDThread: for I/O completion on disk vd13
$Hostname6: 0x7F2D109F4240 ( 25342) waiting 500 seconds, NSDThread: for I/O completion on disk vd14
I would like to filter the lines where the wait time is greater than an arbitrary value (let's say 600 seconds). What's the best way to do this in bash?
bash
I am working with a log file that contains entries that appear like this:
$Hostname1: 0x7FDBF4B1AB10 ( 23698) waiting 100 seconds, NSDThread: for I/O completion on disk vd4
$Hostname2: 0x7F2D10A2F8C0 ( 25393) waiting 200 seconds, NSDThread: for I/O completion on disk vd35
$Hostname3: 0x7F2D109F4290 ( 25343) waiting 900 seconds, NSDThread: for I/O completion on disk vd11
$Hostname4: 0x7FDBF4B1AB30 ( 23698) waiting 100 seconds, NSDThread: for I/O completion on disk vd40
$Hostname5: 0x7F2D10A2F830 ( 25392) waiting 750 seconds, NSDThread: for I/O completion on disk vd13
$Hostname6: 0x7F2D109F4240 ( 25342) waiting 500 seconds, NSDThread: for I/O completion on disk vd14
I would like to filter the lines where the wait time is greater than an arbitrary value (let's say 600 seconds). What's the best way to do this in bash?
bash
bash
edited 43 mins ago
Goro
7,48253169
7,48253169
asked 46 mins ago
Kasper
318112
318112
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
6
down vote
accepted
This awk
will get you want you want.
awk '$6 > 600 print ' file
$Hostname3: 0x7F2D109F4290 ( 25343) waiting 900 seconds, NSDThread: for I/O completion on disk vd11
$Hostname5: 0x7F2D10A2F830 ( 25392) waiting 750 seconds, NSDThread: for I/O completion on disk vd13
or per @Kusalananda, this linear is enough
awk '$6 > 600 ' file
thanking you for help this is what i want
– Kasper
40 mins ago
2
You may drop theprint
bit if you wish.
– Kusalananda
39 mins ago
@Kusalananda correct I didn't think about that. Thanks ;-)
– Goro
37 mins ago
1
There's a certain value in keepingprint
under some circumstances, which is that it's helping to clarify the code. This becomes important when multiple people with varying degrees ofawk
knowledge needs to understand exactly what's happening. Particularly (not applicable here though), this may be the case when most avidawk
-ers may want to use1
in place ofprint
in a piece ofawk
code. To a non-initiated, this may be confusing.
– Kusalananda
33 mins ago
@Kusalananda thanks!
– Goro
29 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
This awk
will get you want you want.
awk '$6 > 600 print ' file
$Hostname3: 0x7F2D109F4290 ( 25343) waiting 900 seconds, NSDThread: for I/O completion on disk vd11
$Hostname5: 0x7F2D10A2F830 ( 25392) waiting 750 seconds, NSDThread: for I/O completion on disk vd13
or per @Kusalananda, this linear is enough
awk '$6 > 600 ' file
thanking you for help this is what i want
– Kasper
40 mins ago
2
You may drop theprint
bit if you wish.
– Kusalananda
39 mins ago
@Kusalananda correct I didn't think about that. Thanks ;-)
– Goro
37 mins ago
1
There's a certain value in keepingprint
under some circumstances, which is that it's helping to clarify the code. This becomes important when multiple people with varying degrees ofawk
knowledge needs to understand exactly what's happening. Particularly (not applicable here though), this may be the case when most avidawk
-ers may want to use1
in place ofprint
in a piece ofawk
code. To a non-initiated, this may be confusing.
– Kusalananda
33 mins ago
@Kusalananda thanks!
– Goro
29 mins ago
add a comment |Â
up vote
6
down vote
accepted
This awk
will get you want you want.
awk '$6 > 600 print ' file
$Hostname3: 0x7F2D109F4290 ( 25343) waiting 900 seconds, NSDThread: for I/O completion on disk vd11
$Hostname5: 0x7F2D10A2F830 ( 25392) waiting 750 seconds, NSDThread: for I/O completion on disk vd13
or per @Kusalananda, this linear is enough
awk '$6 > 600 ' file
thanking you for help this is what i want
– Kasper
40 mins ago
2
You may drop theprint
bit if you wish.
– Kusalananda
39 mins ago
@Kusalananda correct I didn't think about that. Thanks ;-)
– Goro
37 mins ago
1
There's a certain value in keepingprint
under some circumstances, which is that it's helping to clarify the code. This becomes important when multiple people with varying degrees ofawk
knowledge needs to understand exactly what's happening. Particularly (not applicable here though), this may be the case when most avidawk
-ers may want to use1
in place ofprint
in a piece ofawk
code. To a non-initiated, this may be confusing.
– Kusalananda
33 mins ago
@Kusalananda thanks!
– Goro
29 mins ago
add a comment |Â
up vote
6
down vote
accepted
up vote
6
down vote
accepted
This awk
will get you want you want.
awk '$6 > 600 print ' file
$Hostname3: 0x7F2D109F4290 ( 25343) waiting 900 seconds, NSDThread: for I/O completion on disk vd11
$Hostname5: 0x7F2D10A2F830 ( 25392) waiting 750 seconds, NSDThread: for I/O completion on disk vd13
or per @Kusalananda, this linear is enough
awk '$6 > 600 ' file
This awk
will get you want you want.
awk '$6 > 600 print ' file
$Hostname3: 0x7F2D109F4290 ( 25343) waiting 900 seconds, NSDThread: for I/O completion on disk vd11
$Hostname5: 0x7F2D10A2F830 ( 25392) waiting 750 seconds, NSDThread: for I/O completion on disk vd13
or per @Kusalananda, this linear is enough
awk '$6 > 600 ' file
edited 37 mins ago
answered 44 mins ago
Goro
7,48253169
7,48253169
thanking you for help this is what i want
– Kasper
40 mins ago
2
You may drop theprint
bit if you wish.
– Kusalananda
39 mins ago
@Kusalananda correct I didn't think about that. Thanks ;-)
– Goro
37 mins ago
1
There's a certain value in keepingprint
under some circumstances, which is that it's helping to clarify the code. This becomes important when multiple people with varying degrees ofawk
knowledge needs to understand exactly what's happening. Particularly (not applicable here though), this may be the case when most avidawk
-ers may want to use1
in place ofprint
in a piece ofawk
code. To a non-initiated, this may be confusing.
– Kusalananda
33 mins ago
@Kusalananda thanks!
– Goro
29 mins ago
add a comment |Â
thanking you for help this is what i want
– Kasper
40 mins ago
2
You may drop theprint
bit if you wish.
– Kusalananda
39 mins ago
@Kusalananda correct I didn't think about that. Thanks ;-)
– Goro
37 mins ago
1
There's a certain value in keepingprint
under some circumstances, which is that it's helping to clarify the code. This becomes important when multiple people with varying degrees ofawk
knowledge needs to understand exactly what's happening. Particularly (not applicable here though), this may be the case when most avidawk
-ers may want to use1
in place ofprint
in a piece ofawk
code. To a non-initiated, this may be confusing.
– Kusalananda
33 mins ago
@Kusalananda thanks!
– Goro
29 mins ago
thanking you for help this is what i want
– Kasper
40 mins ago
thanking you for help this is what i want
– Kasper
40 mins ago
2
2
You may drop the
print
bit if you wish.– Kusalananda
39 mins ago
You may drop the
print
bit if you wish.– Kusalananda
39 mins ago
@Kusalananda correct I didn't think about that. Thanks ;-)
– Goro
37 mins ago
@Kusalananda correct I didn't think about that. Thanks ;-)
– Goro
37 mins ago
1
1
There's a certain value in keeping
print
under some circumstances, which is that it's helping to clarify the code. This becomes important when multiple people with varying degrees of awk
knowledge needs to understand exactly what's happening. Particularly (not applicable here though), this may be the case when most avid awk
-ers may want to use 1
in place of print
in a piece of awk
code. To a non-initiated, this may be confusing.– Kusalananda
33 mins ago
There's a certain value in keeping
print
under some circumstances, which is that it's helping to clarify the code. This becomes important when multiple people with varying degrees of awk
knowledge needs to understand exactly what's happening. Particularly (not applicable here though), this may be the case when most avid awk
-ers may want to use 1
in place of print
in a piece of awk
code. To a non-initiated, this may be confusing.– Kusalananda
33 mins ago
@Kusalananda thanks!
– Goro
29 mins ago
@Kusalananda thanks!
– Goro
29 mins ago
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f473974%2fextract-lines-containing-certain-value-or-greater%23new-answer', 'question_page');
);
Post as a guest
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
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
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