When asking regex questions, always add the tag for the specific programming language or tool (e.g., Perl, Python, or Java; vi, emacs, or ɢɴᴜ grep; etc.) you are using.

learn more… | top users | synonyms (1)

1
vote
1answer
23 views

Filtering Berkeley Research Scanning Nginx logs with Logcheck

I'm getting Nginx log entries from http://researchscan1.eecs.berkeley.edu/ (and others), with lots of special characters in the requests, which I'm trying to filter out. E.g.: 2016/07/19 09:54:49 [...
0
votes
1answer
16 views

Certificate SAN support regexp stemming?

Searched on this, but can't find any clear answer - can a certificate SAN contain a name like "citrix*.domain.com", to permit use with citrixdirector.domain.com and citrixprod.domain.com, for example?
0
votes
1answer
9 views

Varnishncsa for Varnish 4 split log by Vhost

In the varnish 3, varnishncsa can support -m option (-m tag:regex only list records where tag matches regex. Multiple -m options are AND-ed together. ). After upgraded to varnish 4, I cannot find the -...
0
votes
0answers
30 views

Use RegEx to redirect all of website EXCEPT one URL

I've been directed here by support at WPengine, but I'm not sure whether this question should be asked here or over on Overflow... I'm using RegEx to redirect all paths and pages of a sub-domain to ...
0
votes
0answers
18 views

xinetd TFTP remap file & dnsmasq as PXE server

I'm playing with Openstack Ironic for the last few days. I am interested primarily in IPMI+PXE boot. So, in Ironic installation guide I have found the following xinetd tftp map file: re ^(/tftpboot/) ...
0
votes
1answer
12 views

Apache location directive - PCRE negative combinations (match all but..)

Yes, I'm stuck still using apache2.2 on a system and I'm trying to use a PCRE with the apache Location directive looking for any URL not containing any images or similar. Here's some things I've ...
1
vote
1answer
34 views

Fixing fail2ban regex rule for php-url-fopen filter

I'm fixing default php-url-fopen filter to allow some GET query parameters which I'm using in my system (it's not publicly available, but I would still like to block unnecessary requests). The problem ...
0
votes
1answer
26 views

What's the error in my HTACCESS

index page and profile page show 404 after htaccess redirection I transfered from bogger to wp.. redirected all links from year/month/postname.html to postname/ using these lines: # WPhtc: Begin ...
0
votes
1answer
34 views

Logstash issue matching a substring of custom field

I have the following Logstash setup. Logs are piped to Logstash from Logspout via the logspout-logstash adapter, which adds a few fields to log messages, namely the docker.image field. I am able to ...
-1
votes
1answer
39 views

Nmap how to split and filter this(regex)?

I think i need a regex code to filter nmap output.txt I use a tool called: Word List Updater 2.7 so this is the output: http://pastebin.com/HwgiVHDA I want to filter,remove duplicates and look like ...
1
vote
1answer
45 views

Postfix Header_Check Regex 'Does Not Match' issue

I am trying to configure Postfix to NOT accept outbound messages with FROM addresses other than my own domains. The following regex successfully rejects only 3 domains: /etc/postfix/header_checks: /(...
0
votes
0answers
28 views

Fail2ban on CentOS, dovecot filters regex not matching logs

I'm starring at this regex for some time now and it seems perfectly matching lines from my log files but I can't get it to work, not even with modifications. I suspect the problem might be with the ...
0
votes
1answer
24 views

Using RewriteRule to match RewriteMap value and ignore any trailing slash and characters?

I'm trying to use RewriteMap in a apache 2.4 virtualhost .conf file to redirect a number of URLs. A variety of requests can refer to a single entry in the map and I'm having trouble matching these ...
1
vote
1answer
51 views

fail2ban: regex to block \x00 requests?

Every once in a while my server goes down, and when I check my nginx logs, I usually see something like this: 78.37.54.31 - - [20/Apr/2016:20:58:51 +0300] "\x00\x00\x00TZ\x00\x00\x00\x00\x00\x00\x00\...
0
votes
1answer
45 views

Simple nginx server_name regex does not find match

I have an nginx box running version 1.8.1 on AWS. I am converting numerous DNS routing conditions into nginx and have encountered many DNS entries where *.yet_another_domain.* would be useful, but ...
0
votes
0answers
7 views

Odd regex behaviour matching newlines with s and m modifiers

I wish to remove a block of code from a file - along with any unnecessary newlines. Input file 'test' <block 1> nothing here </block> <block 2> foo bar </block> <block 3&...
1
vote
0answers
22 views

nginx and site.erb: tag as internal users for two different domains and two different sets of IPs

I have an nginx server and a site.erb file and two different domains (domain1 and domain2). Currently a tag (for Google Tag Manager) will be set when someone visits the sites from a particular set of ...
0
votes
0answers
24 views

NGINX not recognizing $request

Well.. NGINX or me guess.. something that I'm not doing OK. The point is, I'm getting some request from bots of this type: 91.123.1.56 - - [04/Apr/2016:12:13:39 +0200] "V\x5CxA1po\x5CxA9^\x5Cx8F\...
0
votes
0answers
44 views

fail2ban regex correctly write

Sorry for my bad english. Server nginx. Block /administrator/ http_access_module nginx-error.log [error] 10934#0: *11435 access forbidden by rule, client: 213.87.x.x, server: localhost, request: "...
0
votes
1answer
36 views

Postfix header_checks and unicode regexp

Does postfix support unicode regular expressions like \p{Han} to detect unicode scripts? I would like to use them with header_checks.
1
vote
1answer
25 views

Rewrite bad url extention to .html in NGINX

A while back I made a mistake writing my urls and Google has them cached in old sitemaps. This is creating a ton of 404 errors in WMT that I need to clean up with a solid rewrite. I currently use the ...
0
votes
2answers
46 views

Serving images from two different directories with Nginx

This should be basic... I'm brand new, and no amount of googling and searching stack exchange is helping. I have a website that I want to be able to serve images from, from different directories. I ...
2
votes
1answer
98 views

mod_rewrite with multiple QUERY STRINGS

This is an extension to my question http://serverfault.com/a/761474/77231 I am trying to add an additional QUERY STRING parameter to the URL and change spaces to underscores but am having no success. ...
0
votes
0answers
79 views

Regex nginx location with named location

I have the following set up - a production version of some software; location @myradio { rewrite ^/myradio/([^/]+)/([^/]+)/? /myradio/index.php?module=$1&action=$2 last; rewrite ^/...
1
vote
1answer
26 views

Nginx rewrite to remove .php from files has no effect but to redirect to homepage

I'm trying to make a rewrite to remove .php from my URLs but so far no luck. Here's what I've got so far and then my results with this config below. location ~ \.php$ { try_files $uri/ @...
1
vote
1answer
52 views

Exchange 2013 RegEx transport rule

I am looking to create some transport rules for outgoing email based upon AD properties. eg. Phone: 123-456-7890 Where the actual inserted code looks like "Phone: %%PhoneNumber%%", retrieving the ...
-1
votes
1answer
38 views

Nginx redirect 2 level subpaths

I have the following redirect rule: rewrite ^/path1/(.+)$ /path1/index.php?/$1 last; rewrite ^/path2/(.+)$ /path2/index.php?/$1 last; rewrite ^/path3/(.+)$ /path3/index.php?/$...
0
votes
1answer
33 views

.htaccess config not working properly

Here is my current situation: Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d [NC] RewriteCond %{REQUEST_FILENAME} !-f [NC] #the rule RewriteRule ^post....
0
votes
1answer
18 views

Implement apache equivalent mod_rewrite functionality in lighttpd

Here's the mod_rewrite .htaccess file which is meant to work on Apache Servers for my web-app RewriteEngine On RewriteBase /cs200/tokens/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{...
0
votes
1answer
608 views

Block specific URL in HAProxy / url-encoding

I'm trying to restrict access to a specific URL. It should not allowed to access /admin.php. frontend example acl restricted_page path_beg -i /admin\.php http-request deny if restricted_page ...
0
votes
1answer
54 views

Insert a variable route path into nginx location configuration

I have a simple user based storage for images where I have a main folder say 'users' and within it, my server creates variable folders to store images for each user. The string used for the folder is ...
0
votes
1answer
232 views

match special characters in url in nginx

I ran dotdotpwn to test transversal attacks on a web server using nginx/nasxi/doxsi and the only "successes" were urls that started with a question mark. No big deal since they just defaulted to the ...
0
votes
0answers
32 views

Regex in Exchange transport rule

We are receiving external emails with invalid characters in the emails address which is causing issues for applications linked to the mailboxes. The receipient addresses contain single quotes ('name@...
0
votes
1answer
101 views

url rewrite, nginx throw 404 errors, nothing in error logs

below rewrite works fine: rewrite ^/city/restaurants$ /city/listings/restaurants permanent; but this doesnt work rewrite ^/city/restaurants$ /city/listings/restaurants last; rewrite ^/city/...
1
vote
0answers
17 views

URL rewrite is producing 404

I'm trying to rewrite office.domain.com/app1 requests to server3:81 using the rule below, but I'm getting a 404. I can browse to server3:81 just fine. The Failed Request Tracing logs are available ...
0
votes
0answers
40 views

Redirect lang set in url with Nginx regex

I can't find the way to redirect the lang set in url with Nginx. I tried this: location ~ ^/(en|fr|de)/cloud/signup { return 301 $scheme://cloud.$host/$1/home/new; } Also this: location ^/(.*)/...
1
vote
2answers
81 views

Exim: match recipient address against certain regex and conditional email delivery

I need to allow my customers to use e-mails in format of 4ca2bc00-6789-4161-bae7-c11c5b91454e@example.com, where the username part is sort of UUID. Those emails should be delivered to certain (single) ...
3
votes
1answer
68 views

Regex location block not working in NGINX

I have a pretty simple location block in my nginx conf that looks like this: location ~* ^\/[a-z0-9]{24}$ { // do some things } I'm attempting to catch urls that end in a Mongo ObjectId. eg: ...
0
votes
0answers
12 views

Apache ProxyPass rules to stop at first match [duplicate]

I want to stop ProxyPass rules to stop executing at first match. I've given some rewrite rules in the end. So Rewriterules are getting executed all the time. Below is the two lines, i want to work ...
1
vote
1answer
115 views

Fail2Ban regex to match these lines?

I've been trying to get fail2ban to work with the Xeams email spam filter. But, I can't figure out what possible regex I should use to match the logs. The logs are in this format. 61.240.144.65 ...
3
votes
2answers
75 views

ubuntu 14.04 Apache 2.4.7 mpm_event Files and FilesMatch not working

We recently switched our Apache 2.4.7 mode from mpm_pre-fork to mpm_event. Since then we haven't been able to get our Files directive to work. <Files "*.php"> Header set Cache-Control "no-...
1
vote
1answer
106 views

Is fail2ban not matching these lines just because of the port?

I would like fail2ban to engage against these lines and block the example IP address included: [Tue Dec 08 12:17:13.622175 2015] [:error] [pid 30390] [client 62.210.88.201:38139] script '/var/www/...
0
votes
0answers
18 views

Nginx: redirect from some-site-username.server to some.site.username.server

Can you help me pls: need configure Nginx that he made next: when we go to some-site-username.server he redirect us to some.site.username.server Main problem - on the server many users, so I can't ...
1
vote
0answers
49 views

How do I set Host Groups on Fail2ban for Wordpress?

I'm trying to set up a custom filter for fail2ban on a wordpress site. I've been following this tutorial but when I try to test my custom filter, I get the error: server.failregex.RegexException: No '...
0
votes
2answers
45 views

.htaccess rule to 301 redirect /?my_foo=bar to /foo/bar/

I tried, unsuccessfully, for hours to build (what I think is) a simple 301 redirect in an htaccess file. My url looks like this: www.example.com/?my_foo=bar And I want it to 301 redirect to: www....
0
votes
2answers
125 views

Prepend String using perl/awk/sed?

I'm trying to script a change to my apache config file (httpd.conf). I'm trying to match the following string: # # DirectoryIndex: sets the file that Apache will serve if a directory And PREPEND ...
1
vote
1answer
164 views

Nginx Config Location Regex With Language Code In Url

Trying to achieve constant language code in url's 1st segment with nginx regex location configuration and could not find the correct syntax. Necessary result: example.com stays example.com example....
1
vote
1answer
75 views

How to parse s3 logs?

I've been trying to parse AWS S3 logs following the documentation, but I've been running into some problems. Specifically, I keep running into new, rare log lines that break my regex. Every time this ...
1
vote
0answers
52 views

How to modify the message string being logged by syslog?

I have a few linux systems with the keyboard and console shared via a KVM switch. When I switch between them, I get a lot of unwanted syslog messages regarding the keyboard connecting and ...
1
vote
1answer
51 views

Redirect page to 410 if match a specific Regex in .htacces

First time using .htaccess so I come here to have a bit of help since the web is not that file with informations (or I just don't find them :/). So the idea is that I want to redirect link ending by /...