Hi, All,
I wonder how to change the field separator of grep from : to space when use grep to display.
for example when I use
grep -e 'pattern1' -e 'pattern2' -n filename
to find patterns, it use : to separate patterns, but I want to use blank space. is there an option I can set to... (2 Replies)
the file has several date fields.for example, #2, #3,and #5 are date fields.
I want grep year '2002' just within #2 field and get all the rows which content year '2002' in the #2 field. is it possible to do this? how to do it? Thanks (2 Replies)
hi,
I would like to search for a specific string at a specific line in a file and would like to know the count of it.
eg: samp.txt
ABC 1234 BELL
HNZ 4567 RING
NNN 5673 BELL
Please help with the command to find the count of BELL in the above file samp.txt at the specific line 10 with... (7 Replies)
Hi All,
I have the following in a text file
#---- Set Silent License Acceptance
#---- Accept license agreement: remove # sign
#---- example: LICENSE_ACCEPTED=true
#---- if the LICENSE_ACCEPTED is anything other then true the installation will exit
#---- no log... (2 Replies)
hi all,
i have a data sm thg like this
28504 0 abc 148782859 42 101M nhmmmm ilopo abc 2345432
i want to get only the field which is just aftr abc i,e., 148782859, 2345432
i have used grep /abc\t/ filename to get that but its not working can any 1 help me out (5 Replies)
Hello. How does one grep lines in a file that have only one field?
AAA BBB CCC
DDD
AAA CCC
Is is possible to grep "DDD" becuase it has only one field?
Thanks.
---------- Post updated at 08:03 PM ---------- Previous update was at 07:25 PM ----------
I found it, thank you!
awk 'NF... (2 Replies)
hi,
i have a text file with some fields.
file.txt
aaa|bbb|ccc|1-sh|2-sh|5-sh
ddd|eee|fff|1-sh|4-sh
i am selecting a line using grep command using the combination of 1st 3 column.
grep "aaa|bbb|ccc" file.txt
output:
aaa|bbb|ccc|1-sh|2-sh|5-sh
now i want to cut a field from this... (5 Replies)
I want to grep based on first column and print all the columns. for eg.
root 12344 /sh
root 33389 /bash
oracle 87378 /tech/oracle
oracle 26367 /tmp/oracle
Now I want to grep based on user "root" in first column and print like below.
root ... (14 Replies)
I have a file like this. I want to filter values for only the particular day.
Source file:
# cat /tmp/1
Name Mon Tue Wed Thu Fri Sat Sun
A Y
B Y
C Y
D Y
F Y
G Y Y
#
For ex:
I want to... (4 Replies)
Discussion started by: thomasraj87
4 Replies
LEARN ABOUT DEBIAN
ausearch_add_item
AUSEARCH_ADD_ITEM(3) Linux Audit API AUSEARCH_ADD_ITEM(3)NAME
ausearch_add_item - build up search rule
SYNOPSIS
#include <auparse.h>
int ausearch_add_item(auparse_state_t *au, const char *field, const char *op, const char *value, ausearch_rule_t how);
DESCRIPTION
ausearch_add_item adds one search condition to the current audit search expression. The search conditions can then be used to scan logs,
files, or buffers for something of interest. The field value is the field name that the value will be checked for. The op variable
describes what kind of check is to be done. Legal op values are:
exists
just check that a field name exists
=
locate the field name and check that the value associated with it is equal to the value given in this rule.
!=
locate the field name and check that the value associated with it is NOT equal to the value given in this rule.
The value parameter is compared to the uninterpreted field value.
The how value determines how this search condition will affect the existing search expression if one is already defined. The possible val-
ues are:
AUSEARCH_RULE_CLEAR
Clear the current search expression, if any, and use only this search condition.
AUSEARCH_RULE_OR
If a search expression E is already configured, replace it by (E || this_search_condition).
AUSEARCH_RULE_AND
If a search expression E is already configured, replace it by (E && this_search_condition).
RETURN VALUE
Returns -1 if an error occurs; otherwise, 0 for success.
SEE ALSO ausearch_add_expression(3), ausearch_add_interpreted_item(3), ausearch_add_timestamp_item(3), ausearch_add_regex(3), ausearch_set_stop(3),
ausearch_clear(3), ausearch_next_event(3), ausearch-expression(5).
AUTHOR
Steve Grubb
Red Hat Nov 2007 AUSEARCH_ADD_ITEM(3)