Questions tagged [filter]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
32 views

Match contents of first file with second to generate third file

Sample data of my first file first.txt is below: 10.0.0.1,Web Server,comments1,jboss is older version,myappcode1 10.0.0.3,Web Server,comments4,httpd is latest version,myappcode15 10.0.0.7,Web Server,...
-1
votes
0answers
16 views

MAC address on google cloud platform problem

I want to secure my server(on google cloud platform) through logging ssh only local network the oder vps. So I added IPTABLES rules with filter IP address and filter MAC ADDRESS. With IP source no ...
-1
votes
1answer
25 views

Qemu network traffic filtering with iptables

I need to filter both outcoming and incoming traffic of the guest system on Qemu (Linux). The host system is Linux too. I think iptables is a good tool, but I don't know how to use it here. What ...
-1
votes
1answer
39 views

rsync only particular file types in subdirectories with a fixed maximum depth

I want to sync all *.sh files in exactly one sub directory. I tried this cmd but all files in a directory are synced instead of only particular file types. rsync -vr -n --include="*.sh" --...
0
votes
1answer
25 views

how can i pull data based on certain flags for rows of data and create a new file with them

I'm working with Upper Air Balloon data with a format of .... **254 12 1 JAN 2002 1 94703 72501 40.87N 72.87W 20 1116** 2 100 100 250 40 32767 3 **3 ...
0
votes
1answer
23 views

filter by incoming ip v4 packets with tcpdump

I want to filter with TCPDUMP only incoming and ip v4 packets. tcpdump -i eth0 inbound and ip -w res.pcap give me incoming packets with ipv4 and ipv6 How can I filter by ipv4 only?
-1
votes
1answer
33 views

postfix modify subject based on sender

There is a map: email1@example.com ONE email2@example.com TWO email3@example.com THREE How to change subject in mails sent to test@example.net this way: (from email1@example.com, original subject ...
0
votes
1answer
26 views

Filter rows of a file by list of a second file

file1.tabular contains information of 'elements' over 3 columns. element1 235 oval red \ element2 334 oval red \ element3 356 rectangular blue file2.txt contains a single column element1\ element3 I ...
0
votes
3answers
131 views

How to limit grep to scan only the first 10 lines?

I got a command foo that output a list of files separated by \n line. I am using the below command to filter the results by regex content of the files. foo | xargs grep -l regex The problem is that ...
2
votes
2answers
82 views

Filter a list of files by content

I got a command foo that outputs a list of files separated by a new line. How can I filter those files by their content using regex, and output the filtered files list?
1
vote
1answer
31 views

Picking selected items from stdin via choices typed into console

Can anyone point me at a 'pick' filter script that works somewhat as described below? I've spent about an hour hunting for a simple bash script/filter that will allow me to pipe in a list of values ...
0
votes
0answers
8 views

How exclude files with Kate Project plugin filter?

How do I exclude files from a project in Kate? I'm trying to exclude Ubuntu backup files from a project. Those are files ending with a tilde "~". I can get a Kate project to include list of all files ...
0
votes
1answer
17 views

searching logs for failures using grep with wordlist?

I am building a wordlist which will contain words like error,fail,kill,warn,out of,over,too.....etc. so that I can filter tons of logs for issues within seconds using grep. Especially, it's for ...
0
votes
1answer
16 views

Save “unseen” output of command to file

I have a program that returns some content every time I run it. Some of that content may have already shown during the last run. foo bar baz and on next execution it might show two "old lines" and ...
1
vote
2answers
334 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
14 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
143 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
34 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
40 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
92 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
442 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
193 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
55 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
65 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
1k 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
73 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
110 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
44 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
2answers
82 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
123 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
81 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
1k 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
57 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
125 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
323 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
2k 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
338 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
5k 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
66 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
2k 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
804 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
153 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
59 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
38 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. + + + +New ...
0
votes
2answers
509 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 ...
1
vote
1answer
692 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
94 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 ...