Questions tagged [filter]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
50 views

bash: filter text stream by command result

Is there a standard tool that can filter text stream based on command execution result? Consider grep for example. It can filter text stream based on regex. But the more general problem is extending ...
0
votes
0answers
11 views

Tomcat: Activate a Tomcat Filter on specific source IP addresses

I am a Tomcat N00b so my search terminology for google may be lacking. But so far I have not found the answer to my question(s). I have a scenario where I have some traffic coming in through a WAF ...
1
vote
1answer
42 views

Ansible - negative filter question

I am writing an Ansible playbook that grants and rejects access to some dirs. Base is a list of user dictionaries: users: - {name: 'user1', dirs: ['dir1', 'dir2']} - {name: 'user2', dirs: ['dir1',...
0
votes
1answer
28 views

Iptable order of rules with example

I had question about IPtables. Let's start with this example of my book: What rules you would set for a mail server accepting connections for EMSTP (port 465) and IMAP (port 993) having a ...
0
votes
1answer
28 views

Ansible hostname resolution with ipaddr filter returns False?

I'm trying to figure this out. How does the Ansible IP Addr filter work, this always seems to return False $ ansible -m debug -a 'msg={{"www.google.com"|ipv4}}' 10.1.38.15 10.1.38.15 | SUCCESS => {...
0
votes
2answers
65 views

grep with filter grep, how?

All I need is the Zip file name. In the first step I searched for the author: egrep -ni -B1 --color "$autor: test_autor" file_search_v1.log > result1.log whatever worked, the result was: zip: /...
0
votes
1answer
109 views

Filter script output during runtime

I have a script that runs about 10 other scripts in the background that constantly generate new output. I would like to keep that initial script running and be able to simply type in it to filter all ...
0
votes
1answer
55 views

grep for pattern

I have a file where I want to grep for an md5 hash. I was able to do that but how can I display the match to stdout? When I do grep -e "[0-9a-f]\{32\}" file I just get: Binary file file matches. ...
0
votes
1answer
33 views

Filter dmidecode memory controller for supported speeds

as a newbie to linux kernel and all the commands, I am reaching out to you guys, hoping you can help me solve my issue. When running the next command sudo dmidecode -t 5 I get the following output: ...
1
vote
2answers
34 views

Sed output before substitute

I am trying to do some sed operation while substituting output. The specific case is the following: with output Date:080910 111411 I want to only keep Date:XXXXXX and filter out the space with the ...
1
vote
0answers
24 views

Serve view of directory's most recent files only

I have a directory with ~100k files that loads very slowly over the internet through most protocols (just listing the directory can time out). I'd like to speed things up by only showing files from ...
0
votes
2answers
64 views

Compare the first five elements of a column to the rest

I hope you can help me to fix this problem. I want to compare the first five elements of a column to the rest elements (column by column). If the first 5 elements are equal --> continue If the ...
2
votes
2answers
554 views

Filtering the output from the ping command

I have a fairly simple little script. Basically, it performs ping over a given domain. It is like this: ping -c2 $1 | head -n4 And it prints out for example: PING google.com (172.217.17.206): 56 ...
0
votes
1answer
66 views

Filtering a .txt file using a regular expression and a second file

I have a file.txt (it does not have the same number of columns for each row): e.g. 1 21:10 21:23 2 1:94 1:100 1:123 3 14:1 14:60 14:23 I have another file (file2.txt) that contains 4 columns (...
0
votes
2answers
46 views

how to keep only lines with specific word

I have a huge text with multiple columns and rows and I want to keep the lines that consist one specific word (no matter in which column)... (if possible I also like to have two separate specific ...
0
votes
1answer
35 views

Filter directory list text file based on the short common root directory

I have a list of directories similar to the below in a .txt file /Season_1/101 /Season_1/101/Thumbnails /Season_1/101/Thumbnails/Branded /Season_1/101/massive_screengrabs /Season_1/102/...
0
votes
0answers
52 views

xupnpd2 mediaserver filter log-messages

I use the xupnpd2 media server (https://github.com/clark15b/xupnpd2) on the router to stream a few HLS streams to the TV. The software would have to be extended by HTTPS and the HLS processing adapted ...
0
votes
2answers
70 views

Filtering find output to find only the real source files?

I have a big directory tree with sources files (*.c), where some, (but not all), of which are actually generated via a preprocess which produces the whatever.c from a whatever.qc file. Often, I find ...
0
votes
0answers
92 views

fdm mail filtering: avoiding archiving messages that have been “flagged”

I'm using fdm to fetch, filter, sort and archive my email. For archiving mail, I have a "disabled" account called archive that I invoke with fdm -a archive, which makes fdm go through all my various ...
0
votes
1answer
54 views

awk filtering one column log file

I'm trying to use the following command to extract a time period forthe current day date and grep for the specific message as you can see below: awk -v date="$(date +%Y%m%d')" '$1="date" && $...
2
votes
1answer
725 views

rsync: Use filters to exclude top-level directory but include some of its subdirectories

I want to back up my /home directory with rsync. I have read rsync's man page and decided to use filter rules for this task. What I would like to achieve: Exclude all files and directories in the ...
2
votes
2answers
52 views

procmailrc-Killfile for recipient addresses?

I want to block mails with certain recipient addresses using procmailrc (temporary addresses that now only receive spam). I found a code sample for using a killfile/blacklist, but it only applies to ...
5
votes
4answers
96 views

Replicate directory structure applying a command to each file instead of simply copying it?

Over time, I've encountered the same pattern again and again: I have some kind of directory structure: example/ ├── a │   └── c │   ├── d.txt (120k) │   └── e.txt (60k) └── b └── f.txt (...
0
votes
0answers
30 views

Filter output / print one record per event or time period

I've got a custom HID device which prints out exact coordinates of touched points at real time. It is very sensitive & currently printing out the coordinate that's being touched on multiple ...
2
votes
1answer
262 views

Filter files by string timestamp in filename

I've got a folder with several thousand files with names like ousjgforuigor-TIMESTAMP.txt The timestamp is a standard Unix timestamp (e.g. 1543932635). Is there an easy way to list only files with a ...
-1
votes
2answers
989 views

jq: colorize selected field of json file [closed]

Extend of this question: jq: parse json file with constraint from other field After select "name" field I'd like to colorize it: { "checksum": "9e44bb7b76d8c39c45420dd2158a4521", "roots": { ...
0
votes
1answer
285 views

jq: parse json file with constraint from other field [duplicate]

Extend of this question: How to combine strings from JSON values, keeping only part of the string? Above link's output also include the "name" of folder type, need to exclude these "type": ...
3
votes
1answer
3k views

How to combine strings from JSON values, keeping only part of the string?

I have sample: "name": "The title of website", "sync_transaction_version": "1", "type": "url", "url": "https://url_of_website" I want to get the following ...
0
votes
1answer
42 views

Filter on html tag

With html bookmark saved from chrome or others, frequently exported as html file that comes with <a href tag that I'd like to filter and arrange: <a href="https://<a-web-site>">Title ...
0
votes
1answer
1k views

What is the correct syntax for rsyslog's re_match()?

I'm trying to filter unwanted messages from a cron job (systemd) from rsyslog output. However rsyslog always complains about the second argument of re_match(). The filter rule I have is: if $...
1
vote
1answer
540 views

htop - See/Filter all the instances of a binary

I have a binary that I will be running multiple times in parallel, each instance executed with different input from the command line. I wanted htop to list only these processes so that I can compare ...
2
votes
0answers
143 views

Bypass some domains in exim $message_body if condition

I have a custom exim email filter, sample of which is shown below. Just trying to work out how to bypass the "$message_body contains" part of my filter for specific sender domain names such as ".com" ...
2
votes
1answer
56 views

Filter top(1) display by COMMAND=abc OR COMMAND=xyz

I'm experimenting with the top(1) program, and I'm trying to figure out how to display only specified program names. For example, if I invoke a command line like $ ssh localhost sleep 15 I'd like to ...
-2
votes
2answers
37 views

Filter the below text using shell commands

I am able to get the file difference using git diff command and I got it filtered like below: -This folder contains common database scripts. +This folder contains common database scripts. ...
0
votes
2answers
396 views

Would GREP work to filter a log file based on keywords, dates, timestamps? Or is there a better alternative?

I am trying to filter a log file based on the following: date range of an error (yyyy-mm-dd) timestamp range of an error (01:00:00 - 00:00:00) keywords (previousFireTime, nextFireTime) I've been ...
0
votes
1answer
529 views

Define udev rule for disk by id or uuid?

I want to define a udev rule for a particular block device (or partition). I currently do it by defining a 91-my-custom-rules.rules configuration file as follows: computer:/etc/udev/rules.d # cat 91-...
1
vote
3answers
72 views

Using AWK: how to define printing fields to search for rows containing dates ranging between today and 5 days ago?

I'm trying to summarise this list to contain only 5 days worth of data, from today to 5 days ago. I tried using awk but to no avail. There is no need to stick to awk too. This is the output: This is ...
1
vote
1answer
191 views

How can I list default lpr filters?

I can discard lpr default filters using the -l (or -o raw) option. But how can I list them ? (FWIW I'm using lpr from cups-client 1:2.2.6-15.fc28, Fedora.)
0
votes
3answers
583 views

How to filter ranges of IP addresses?

How could I filter a single IP address or a range of IP addresses to prevent them from accessing my computer? Examples: Block 31.13.76.102 Block from 216.58.192.0 to 216.58.223.255 Block from 173....
0
votes
2answers
67 views

Supress specific output lines of a command

I wanted to search all the files starting with chrom in /var directory. So I executed this $ ls -R | grep "^chrom" To my astonishment, It showed this. Few starting lines look like this : amit@...
0
votes
0answers
91 views

Global filter on clipboard?

I'd like to make kind of filter for clipboard to remove newline characters at the end from anything I copy-paste on a daily basis. I know I could set a daemon listening through xclip for changes and ...
2
votes
2answers
131 views

Holding a Packet

I am trying to alter a stream of packets by temporarily holding a specific packet. For example, if the packet are numbered 1,2,3,4,5, and so on, I want to temporarily store packet 2 so that I can ...
0
votes
1answer
38 views

Write scripts as stream-filters or parameter-only tools? [closed]

I'm writing a set of shell helper scripts - a kind of toolbox for simple data/text_files processing. In it there will be some simple tools like, for example: dateToTimestamp or showParagraphHeads. ...
3
votes
1answer
102 views

Why is column adding a newline in the middle of my row where one is not present in the original data?

I'm analyzing some packetfilter logs and wanted to make a nice table of some output, which normally works fine when I use column -t. I can't use a tab as my output field separator (OFS) in this case ...
1
vote
2answers
615 views

Filter directories from list of files and directories

I have a file containing full path names of files an directories. From this list I would like to filter out any pathnames that reference directories so that I am left with a list containing only file ...
-1
votes
3answers
2k views

bash filter the file names by regex or similar in a while loop

Currently I have the following bash script that gets the width and height of all the files in the directory: ls | cat -n | while read n f; do width=$(identify -format "%w" "$f") height=$(...
1
vote
1answer
217 views

Easy way to filter xml files in a visual way

I am dealing with datasets on xml files; which have the following structure: <?xml version="1.0" standalone="yes"?> <exper> <entry> <Source /> <Status>pass</...
1
vote
1answer
696 views

less: multiple filter conditions with AND

How to specify multiple filter conditions connected with AND in less? I would like to filter a log having lines do NOT contain "nat" but contains an IP address 192.168.1.1, like: &/!nat &&...
1
vote
1answer
706 views

Filter rows with a specific header name and containing “1” in a column

I have a big file with many columns and rows, looks like: A B C D E F1 F2 F3 F4 F5 a1 b1 c1 d1 e1 0 0 1 0 1 a2 b2 c2 d2 e2 1 0 0 1 1 a3 b3 c3 d3 e3 1 1 0 0 1 .... ...
1
vote
0answers
110 views

pf, alf, kext order of operation in os x

What is the order of operation for the packet filter, application layer firewall and 3rd party kexts and applications like Little Snitch, Handsoff, Radio Silence, Vallum in OS X? That is in both ...