newspaint

Documenting Problems That Were Difficult To Find The Answer To

Monthly Archives: February 2018

Splunk Regular Expression Flags

Very little is openly documented about Splunk regular expressions – which is surprising given how important pattern matching is when trawling through large amounts of data.

Most documentation about Splunk regular expressions is found at this linked page.

In addition the two most commonly used functions that utilise regular expressions during searches are:

  • regex – filters based on regular expression, i.e. matches or doesn’t match (if field!=regex syntax is used)
  • rex – allows extraction of named capturing groups from text into parameters, does not filter

Flags

The hint about supported flags comes from the documentation of the regex command which states:

The regular expression must be a Perl Compatible Regular Expression supported by the PCRE library.

Possible flags are described in PHP’s PCRE pattern modifiers page however not all apply to Splunk.

Here are the flags that appear supported in Splunk:

Modifier Behaviour Example Matches When Used
(?i) case insensitive (?i)moon Moon
(?m) ^ and $ can match beginning and end of line as well as string (?m)^The Who art thou?
The butler.
(?s) dot matches newlines (?s)P.G It is P
G.
(?x) extended, white space in expression is ignored (?x)ID \d+ ID4132
(?U) ungreedy, by default make expressions ungreedy, and greedy if question mark used (?U)(M.+t) Meet the president

Citrix Keyboard Shortcuts for Linux Receiver

From this page:

Combination Description
SHIFT+F1 Displays the Windows Task List
SHIFT+F2 Displays or Hides the Windows Title Bar for the Citrix Receiver Client window
SHIFT+F3 Disconnects the ICA session and exits the Citrix Receiver
CTRL+F1 Opens the Windows Security dialog box (similar to CTRL+ALT+DEL)
CTRL+F2 Displays the remote computer’s Start Menu (similar to CTRL+ESC)
CTRL+F3 Displays the Windows Task Manager (similar to CTRL+SHIFT+ESC)
ALT+F2 Cycles through running programs in the Citrix session (similar to ALT+ESC)
ALT+PLUS Switches between programs from left to right (similar to ALT+TAB)
ALT+MINUS Switches between programs from right to left (similar to ALT+SHIFT+TAB)

Building OpenTTD on Debian 9 Stretch amd64

Note the instructions at the OpenTTD development page.

Get the source repository using Git (from repository):

apt-get install git
git clone http://git.openttd.org/tags/1.7.2.git

Get basic build tools:

apt-get install binutils gcc g++ make pkg-config

Get the library dependencies:

apt-get install zlib1g-dev liblzma-dev liblzo2-dev libpng-dev libfreetype6-dev libfontconfig1-dev libsdl1.2-dev libicu-dev

Configure:

./configure --prefix-dir=/opt/openttd

Build:

nice make -j 2

Install:

nice make install

Want to run it inside a LXC container with X Windows and audio? See this article.