Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [filter]

The tag has no usage guidance.

0
votes
0answers
23 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
48 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
1answer
39 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
129 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
39 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
63 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
28 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
123 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
314 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
162 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
699 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
27 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
426 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
185 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
76 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
45 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
34 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
247 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
0answers
318 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
61 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
136 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
297 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
55 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
70 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
97 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
37 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
63 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
228 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
1k 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
71 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
538 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
596 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
84 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 ...
1
vote
0answers
182 views

Does SO_ATTACH_FILTER reset the socket's receive buffer?

If a filter is already set and there are unprocessed packets in the sockets receive buffer will calling SO_ATTACH_FILTER to set a new updated filter flush the buffer, i.e is it the same as BSD's ...
0
votes
0answers
51 views

how to enable info layer in syslog?

syslog usually filter out output trace messages with predefined tag types like: dbg, info, note, warn, err, crit, alert, emerg, etc. What is the proper way to enable/disable syslog filtering during ...
3
votes
1answer
332 views

How do you deal with FreeBSD's periodic reports?

Out of the box, every FreeBSD machine sends two e-mails per day to the administrator (root -- usually aliased to someone): Daily cron output (with status of disks, network interfaces, etc.) Daily ...
-2
votes
1answer
1k views

Grep and filter IP from text file

I had a log file but I want to extract specific ip from the file the log file shown as below for the logfile i only want to get the first part of IP of every line how every I try command below it ...
1
vote
0answers
530 views

SQUID intercept mode using external authentication and ICAP with adaptation_send_username not working

My goal is to transparently filter HTTP and HTTPS URLs based on a user name that is obtained via an external acl type. I am running Squid 3.5.23 in intercept mode, after researching, it seems that ...
0
votes
1answer
7k views

tcpdump ip range

I'm using nfsen and I need to apply a filter to get specific ip range and I can't find the syntax. I searched in the doc of nfdump and tcpdump but nothing. For now the netflows captured provides from ...
1
vote
2answers
504 views

Filter a log file

I tried to filter my log file by the functionality For example: 195.xx.x.x - - [13/Apr/2017:09:60:xx +0200] "POST /userx/index.php?m=contacts&xxxx... 192.xx.x.x - - [13/Apr/2017:09:45:xx +0200] "...
0
votes
1answer
153 views

filter a log file by request

I try to filter my log file by request. I want to filter all the request(that you can find on the 7th column:/userx/index...) that have (m=xxx and a=xxx) or (m=xxx and doajax=xxx) and only have the ...
1
vote
2answers
1k views

Find path that has specific sub directory

Consider path in a directory structure /A/B/C/D /A/B/C/E /A/B/O/P now if I want to list all path which has sub directory C in it, then can it be done through grep? Expected output: /A/B/C/D /A/B/C/...
1
vote
0answers
35 views

How to use cache in proxy and filter by content in Centos 7.3 and Freebsd

I have a proxy server running well, but I would like to know how to filter by content, not only a webpage, and then how to use cache. I am not sure if to use the cache I have to uncomment only a line ...
1
vote
5answers
129 views

List all unique strings in a specific column

I don't know what I have in my huge vcf.gz file that looks like this CHROM POS ALT 12345 1 345632 T 0/1:4,4:8:99:105,0,106 4 032184 C ...
1
vote
2answers
2k views

remove lines from a vcf.gz file with awk command

I just asked a question about filtering out lines with a specific value in a specific column. If I now want to delete lines with a specific value in a specific column. How do I do that? E.g. delete ...
1
vote
1answer
2k views

extract lines with a specific column value with awk command

I would like to extract all lines starting with a 1/1 in "12345" column and put the lines in a new file (-> Newfile.vcf.gz) leaving the first file.vcf.gz intact by using awk command. My file is a file....
2
votes
1answer
502 views

rsyslog7 filter to hostname if no match to regex

So I'm extremely new to rsyslog (recently switch from syslog-ng) and I really like that I can have dynamic filenames... My work has recently started using docker and they're sending a lot of fields in ...
1
vote
0answers
42 views

Filter grep result-set by paths containing folder1/folder2 and trim the current folder path from result-set

I have a grep command like below to search for all .xml files containing given string. grep -rl 'product_list_toolbar_pager' --include='*.xml' --color=always Now I am using this command on remote ...
5
votes
2answers
402 views

Is there a interactive filter tool when paging output?

I would like to take the output from a program and interactively filter which lines to pipe to the next command. ls | interactive-filter | xargs rm For example, I have a list of files that a ...
1
vote
0answers
414 views

ddwrt to openwrt; blocking a host name or domain based on mac address

I'm a recent convert from ddwrt to openwrt. On ddwrt, I could use the lines below to block the amz address for my firetv. I tried doing this on openwrt, but I can still access the address. insmod ...