Dell DX6004S DX Content Router Setup and Configuration Guide - Page 12

<publish&gt

Page 12 highlights

The example above is a good starting point, but it, alone, will not perform the filtering required for this example. In order to select the PrimaryDR cluster as the destination of some of the locally stored streams, we want to find all streams whose content metadata contains a header called "DX Storage-priority" whose value starts with either a "1", a "2" or one of the words "high" or "medium". Note that the header name is not case sensitive but the actual header value with a match expression is case sensitive. Here is a select rule that uses a filter with a matches() expression that would accomplish this: matches('\s*[12].*|\s*[Hh]igh.*|\s*[Mm]edium.*') A select clause specifies a pattern for a single set of data to be retrieved by the Subscriber process by name. The select can contain zero or more filter clauses. If there are multiple filter clauses, then all of them must match a stream's metadata before the stream is published. As in HTTP, the order of headers within the metadata is not significant. If there are multiple headers in the stream metadata with the given header-name, then any of them can match the given pattern in order for the select to execute. If there are no filter clauses, then the select matches any and every stream, as in the following: The root tag for a set of DX Content Router rules is called rule-set, which can contain one or more publish tags as shown above. The example rule set below will replicate all high and medium priority streams to the PrimaryDR cluster and all others to the SecondaryDR cluster. It will also also send all streams whose Content-Disposition header does not contain a file name ending with ".tmp" to the Backup cluster. matches('\s*[12].*|\s*[Hh]igh.*|\s*[Mm]edium.*') not matches('.*filename\s*\=.*\.tmp.*') Notice that a rule-set can contain multiple publish clauses, and each publish clause can contain multiple select clauses. The Filter Rules Engine evaluates all content elements for each publish Copyright © 2010 Caringo, Inc. All rights reserved 8 Version 2.2 December 2010

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43

Copyright © 2010 Caringo, Inc.
All rights reserved
8
Version 2.2
December 2010
</rule-set>
The example above is a good starting point, but it, alone, will not perform the filtering required for
this example. In order to select the PrimaryDR cluster as the destination of some of the locally
stored streams, we want to find all streams whose content metadata contains a header called
"DX Storage-priority" whose value starts with either a "1", a "2" or one of the words "high" or
"medium". Note that the header name is not case sensitive but the actual header value with a match
expression
is
case sensitive. Here is a
select
rule that uses a filter with a
matches
() expression that
would accomplish this:
<select name="PrimaryDR">
<filter header="<storageProduct/>-priority">
matches('\s*[12].*|\s*[Hh]igh.*|\s*[Mm]edium.*')
</filter>
</select>
A
select
clause specifies a pattern for a single set of data to be retrieved by the Subscriber process
by name. The
select
can contain zero or more
filter
clauses. If there are multiple
filter
clauses,
then all of them must match a stream’s metadata before the stream is published. As in HTTP, the
order of headers within the metadata is not significant. If there are multiple headers in the stream
metadata with the given header-name, then any of them can match the given pattern in order for the
select to execute. If there are no
filter
clauses, then the select matches any and every stream, as in
the following:
<select name="SecondaryDR">
</select>
The root tag for a set of DX Content Router rules is called
rule-set
, which can contain one or more
publish
tags as shown above. The example rule set below will replicate all high and medium priority
streams to the PrimaryDR cluster and all others to the SecondaryDR cluster. It will also also send
all streams whose Content-Disposition header does not contain a file name ending with ".tmp" to the
Backup cluster.
<rule-set>
<publish>
<select name="PrimaryDR">
<filter header="<storageProduct/>-priority">
matches('\s*[12].*|\s*[Hh]igh.*|\s*[Mm]edium.*')
</filter>
</select>
<select name="SecondaryDR">
</select>
</publish>
<publish>
<select name="Backup">
<filter header="content-disposition">
not matches('.*filename\s*\=.*\.tmp.*')
</filter>
</select>
</publish>
</rule-set>
Notice that a
rule-set
can contain multiple
publish
clauses, and each
publish
clause can contain
multiple
select
clauses. The Filter Rules Engine evaluates all content elements for each publish