<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Anthony Reinke &#187; expression</title>
	<atom:link href="http://www.anthonyreinke.com/tag/expression/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.anthonyreinke.com</link>
	<description>Rambling Thoughts of a Random Mind</description>
	<lastBuildDate>Wed, 01 Feb 2012 22:03:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>RegEx with Splunk for OSSEC</title>
		<link>http://www.anthonyreinke.com/2009/07/30/regex-with-splunk-for-ossec/</link>
		<comments>http://www.anthonyreinke.com/2009/07/30/regex-with-splunk-for-ossec/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 04:12:46 +0000</pubDate>
		<dc:creator>Anthony Reinke</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[expression]]></category>
		<category><![CDATA[ossec]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[regular]]></category>
		<category><![CDATA[splunk]]></category>

		<guid isPermaLink="false">http://www.anthonyreinke.com/?p=75</guid>
		<description><![CDATA[Thanks to Michael Wilde for the information on RegEx in Splunk.  For those like me who aren&#8217;t the best at RegEx, I will show some of the regular expressions I am using for OSSEC. Server Name (?i) Location:s((?P&#60;FIELDNAME&#62;.*?))s Windows Event User (?i) USER: (?P&#60;FIELDNAME&#62;[^:]*); Server IP (?i)^[^)]*)s+(?P&#60;FIELDNAME&#62;[^-]*)- Windows Events (?i)^[^-]*-s+(?P&#60;FIELDNAME&#62;[^.]*). LogInUser (?i) Name: (?P&#60;FIELDNAME&#62;w+) LogInDomain [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to <strong><a rel="external nofollow" href="http://splunkninja.com/">Michael Wilde</a></strong> for the information on RegEx in Splunk.  For those like me who aren&#8217;t the best at RegEx, I will show some of the regular expressions I am using for OSSEC.</p>
<p>Server Name<br />
(?i) Location:s((?P&lt;FIELDNAME&gt;.*?))s</p>
<p>Windows Event User<br />
(?i) USER: (?P&lt;FIELDNAME&gt;[^:]*);</p>
<p>Server IP<br />
(?i)^[^)]*)s+(?P&lt;FIELDNAME&gt;[^-]*)-</p>
<p>Windows Events<br />
(?i)^[^-]*-s+(?P&lt;FIELDNAME&gt;[^.]*).</p>
<p>LogInUser<br />
(?i) Name: (?P&lt;FIELDNAME&gt;w+)</p>
<p>LogInDomain<br />
(?i) Domain: (?P&lt;FIELDNAME&gt;[^ ]*)[ ]</p>
<p>******************************************************</p>
<p>Now, to add them&#8230;</p>
<p>Open your browser and login in to your Splunk server.  In the Search application, type sourcetype=&#8221;ossec&#8221;<br />
<img class="alignnone size-full wp-image-76" title="Type Search ossec" src="http://www.anthonyreinke.com/wp-content/uploads/2009/07/Type-Search-ossec.JPG" alt="Type Search ossec" width="166" height="45" /></p>
<p>or click on &#8220;ossec&#8221; in the Sourcetypes</p>
<p><img class="alignnone size-full wp-image-77" title="Click Search ossec" src="http://www.anthonyreinke.com/wp-content/uploads/2009/07/Click-Search-ossec.JPG" alt="Click Search ossec" width="215" height="260" /></p>
<p>You should see a bunch of data from the OSSEC server.  On the left of the main frame of the webpage, there should be a grey down arrow.  Clicking on this I get two options.  You want to select  Extract Fields.<br />
<img class="alignnone size-full wp-image-78" title="Click Extract Fields" src="http://www.anthonyreinke.com/wp-content/uploads/2009/07/Click-Extract-Fields.JPG" alt="Click Extract Fields" width="125" height="189" /></p>
<p>Here is where it gets fun.  Splunk included a graphical RegEx builder based on examples.  I ended up playing with this for a while.  Once you have found the expression you like, click on the Save button.<br />
<img class="alignnone size-full wp-image-79" title="Click Save RegEx" src="http://www.anthonyreinke.com/wp-content/uploads/2009/07/Click-Save-RegEx.JPG" alt="Click Save RegEx" width="300" height="103" /></p>
<p>Name your RegEx and click Save.<br />
<img class="alignnone size-full wp-image-80" title="Save Field" src="http://www.anthonyreinke.com/wp-content/uploads/2009/07/Save-Field.JPG" alt="Save Field" width="409" height="186" /></p>
<p>Restart your Splunk server.<br />
Once restarted, on the main search page, on the left sidebar click on Pick fields.<br />
<img class="alignnone size-full wp-image-81" title="AddField" src="http://www.anthonyreinke.com/wp-content/uploads/2009/07/AddField.JPG" alt="AddField" width="200" height="155" /></p>
<p>Here you can select the fields that will be displayed on the search page.<br />
<img class="alignnone size-full wp-image-82" title="SelectFields" src="http://www.anthonyreinke.com/wp-content/uploads/2009/07/SelectFields.JPG" alt="SelectFields" width="645" height="530" /></p>
<p>When you get back to the search page, you will notice the new fields.<br />
<img class="alignnone size-full wp-image-83" title="Showing" src="http://www.anthonyreinke.com/wp-content/uploads/2009/07/Showing.JPG" alt="Showing" width="326" height="53" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anthonyreinke.com/2009/07/30/regex-with-splunk-for-ossec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

