Imported Upstream version 2.5.11
[libapache-mod-security.git] / doc / html-multipage / ar01s10.html
1 <html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Macro Expansion</title><link href="modsecurity-reference.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.69.1" name="generator"><link rel="start" href="index.html" title="ModSecurity&reg; Reference
2   Manual"><link rel="up" href="index.html" title="ModSecurity&reg; Reference
3   Manual"><link rel="prev" href="operators.html" title="Operators"><link rel="next" href="ar01s11.html" title="Persistant Storage"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div style="background:#F5F5F5;width:100%;border-top:1px solid #DDDDDD;border-bottom:1px solid #DDDDDD"><table width="100%" cellspacing="0" cellpadding="0"><tr><td><a href="http://www.modsecurity.org"><img style="margin:4px" src="modsecurity.gif" width="120" height="36" alt="ModSecurity" border="0"></a></td><td align="right"><a href="http://www.breach.com"><img style="margin:6px" src="breach-logo-small.gif" height="36" width="100" border="0"></a></td></tr></table></div><div id="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">Macro Expansion</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="operators.html">Prev</a>&nbsp;</td><td align="center" width="60%">&nbsp;<a accesskey="h" href="index.html">Home</a></td><td align="right" width="20%">&nbsp;<a accesskey="n" href="ar01s11.html">Next</a></td></tr></table><hr size="1"></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="N11DF1"></a>Macro Expansion</h2></div></div><div></div></div><p>Macros allow for using place holders in rules that will be expanded
4     out to their values at runtime. Currently only variable expansion is
5     supported, however more options may be added in future versions of
6     ModSecurity.</p><p>Format:</p><pre class="programlisting">%{VARIABLE}
7 %{COLLECTION.VARIABLE}</pre><p>Macro expansion can be used in actions such as initcol, setsid,
8     setuid, setvar, setenv, logdata. Operators that are evaluated at runtime
9     support expansion and are noted above. Such operators include @beginsWith,
10     @endsWith, @contains, @within and @streq. You cannot use macro expansion
11     for operators that are "compiled" such as @pm, @rx, etc. as these
12     operators have their values fixed at configure time for efficiency.</p><p>Some values you may want to expand include: TX, REMOTE_ADDR, USERID,
13     HIGHEST_SEVERITY, MATCHED_VAR, MATCHED_VAR_NAME, MULTIPART_STRICT_ERROR,
14     RULE, SESSION, USERID, among others.</p></div><div id="navfooter"><hr size="1"><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="operators.html">Prev</a>&nbsp;</td><td align="center" width="20%">&nbsp;</td><td align="right" width="40%">&nbsp;<a accesskey="n" href="ar01s11.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%">Operators&nbsp;</td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td valign="top" align="right" width="40%">&nbsp;Persistant Storage</td></tr></table></div><div align="center" class="copyright">Copyright (C) 2004-2009 <a href="http://www.breach.com">Breach Security</a></div></body></html>