[ldm-users] 20110128: Regular Expression Help (ldmd.conf and pqact.conf)

Hi Paul,

re:
>I am trying to trim down my overall request and store only certain files and
>wonder if anybody has some thoughts on good regular expressions to use.
>
>Here is a sample of what is coming into my system:
>
>INFO:     5516 20110112140053.222 CONDUIT 180
>data/nccf/com/nam/prod/nam.20110112/nam.t12z.awipak27.tm00.grib2
>!grib2/ncep/NAM_84/#000/201101121200F027/SPFH/300 hPa PRES! 000180
>INFO:     1795 20110112140053.223 CONDUIT 190
>data/nccf/com/nam/prod/nam.20110112/nam.t12z.awipak27.tm00.grib2
>!grib2/ncep/NAM_84/#000/201101121200F027/TRKE/325 hPa PRES! 000190
>INFO:     8288 20110112140053.227 CONDUIT 213
>data/nccf/com/nam/prod/nam.20110112/nam.t12z.awipak27.tm00.grib2
>!grib2/ncep/NAM_84/#000/201101121200F027/SPFH/400 hPa PRES! 000213
>INFO:     7013 20110112140053.312 CONDUIT 228
>data/nccf/com/nam/prod/nam.20110112/nam.t12z.awipak27.tm00.grib2
>!grib2/ncep/NAM_84/#000/201101121200F027/RELH/450 hPa PRES! 000228
>INFO:     5935 20110112140053.202 CONDUIT 067
>data/nccf/com/nam/prod/nam.20110112/nam.t12z.awipak27.tm00.grib2
>!grib2/ncep/NAM_84/#000/201101121200F027/OMEG/300 hPa PRES! 000067
>INFO:     5573 20110112140053.224 CONDUIT 200
>data/nccf/com/nam/prod/nam.20110112/nam.t12z.awipak27.tm00.grib2
>!grib2/ncep/NAM_84/#000/201101121200F027/CICE/350 hPa PRES! 000200
>
>Let's say for example I only want to get the 400 hPa PRES! portion.  If I
>trap from nam.t12z.awipsak27.tm00.grib2 (I get all the files), but is there
>a way to add a trap for the !grib2 line in the ldmd.conf and/or pqact.conf?

Yes.  I have two comments:

- first, all of the output you sent represent the full product ID for
  each product.  This means that you can fashion an extended regular
  expression that selects sets of products using any portion of the
  ID.

- second, you can use the extended regular expression to refine either/both
  the ~ldm/etc/ldmd.conf REQUEST line(s) or the pattern-action file
  action(s)

re:
>I am sure there is a way, but I thought I would ask the group before I spend
>a lot of time configuring my own regular expressions.

The easiest/best thing to do is to use the LDM 'notifyme' utility to
experiment with extended regular expression patterns that do what you
want (the '-p' flag value specifies the extended regular expression).
For instance, try the following:

<as 'ldm' on your system>

notifyme -vl- -f CONDUIT -o 3600 -p "nam.*400 hPa"

NB: the pattern is sorrounded with double quotes so that the shell
does not try to expand the '.*'.

Once you have figured out the extended regular expression pattern that
gives you what you want, you can use it in your ldmd.conf REQUEST
line and/or in your pattern-action file action(s).

>Thanks for everyone's time.

>Thanks,
>Paul Kirkwood
>Chief, Technology Infusion Branch
>Southern Region Headquarters
>Science and Technology Services
>Email: Paul.Kirkwood@xxxxxxxx
>Phone: 817-978-1100 x.145

Cheers,

Tom
--
+----------------------------------------------------------------------------+
* Tom Yoksas                                            UCAR Unidata Program *
* (303) 497-8642 (last resort)                                 P.O. Box 3000 *
* yoksas@xxxxxxxxxxxxxxxx                                  Boulder, CO 80307 *
* Unidata WWW Service                            http://www.unidata.ucar.edu/*
+----------------------------------------------------------------------------+