<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do you extract multiple strings of text using rex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-multiple-strings-of-text-using-rex/m-p/185719#M53512</link>
    <description>&lt;P&gt;That works perfectly. Thank you very much!&lt;/P&gt;</description>
    <pubDate>Mon, 02 Jun 2014 18:17:39 GMT</pubDate>
    <dc:creator>TechnicalRS</dc:creator>
    <dc:date>2014-06-02T18:17:39Z</dc:date>
    <item>
      <title>How do you extract multiple strings of text using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-multiple-strings-of-text-using-rex/m-p/185717#M53510</link>
      <description>&lt;P&gt;I have VPN access connect/disconnect events from a Meraki security appliance being fed into Splunk. They show up in Splunk as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jun  2 11:13:37 10.0.0.253 1
1401722017.518634469 Site1_Firewall events client_vpn_connect user id 'username@domainname.com' local ip
192.168.111.165 connected from 10.2.30.44

Jun  2 11:10:02 10.0.0.253 1
1401721802.723896809 Site1_Firewall events client_vpn_disconnect user id 'username@domainname.com' local ip
192.168.111.165 connected from 10.2.30.44
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am needing this data to be less cluttered for a report that shows when users are accessing the VPN, and would only really need something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jun 2 11:10:02 connect username@domainname.com 10.2.30.44
Jun 2 11:13:55 disconnect username@domainname.com 10.2.30.44
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What would be the best method of extracting only the needed information from the logged message? I have read up on the rex command in splunk and while it seems like this would be where I need to be looking, I have absolutely no experience with how to write regular expressions. If anyone can offer a suggestion on how to accomplish this (as well as tips/reading material for understanding and writing regular expressions!) I would be very appreciative &lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2014 17:06:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-multiple-strings-of-text-using-rex/m-p/185717#M53510</guid>
      <dc:creator>TechnicalRS</dc:creator>
      <dc:date>2014-06-02T17:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do you extract multiple strings of text using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-multiple-strings-of-text-using-rex/m-p/185718#M53511</link>
      <description>&lt;P&gt;Try something like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your base search | rex "client_vpn_(?&amp;lt;Action&amp;gt;[^ ]*) user id '(?&amp;lt;UserId&amp;gt;[^']*)'" | rex " connected from (?&amp;lt;IPAddress&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" | eval Message=strftime(_time,"%B %d %H:%M:%S")." ".Action." ".UserId." ".IPAddress | table Message
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Jun 2014 17:36:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-multiple-strings-of-text-using-rex/m-p/185718#M53511</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-02T17:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do you extract multiple strings of text using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-multiple-strings-of-text-using-rex/m-p/185719#M53512</link>
      <description>&lt;P&gt;That works perfectly. Thank you very much!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2014 18:17:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-multiple-strings-of-text-using-rex/m-p/185719#M53512</guid>
      <dc:creator>TechnicalRS</dc:creator>
      <dc:date>2014-06-02T18:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you extract multiple strings of text using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-multiple-strings-of-text-using-rex/m-p/185720#M53513</link>
      <description>&lt;P&gt;And here are some regex cheatsheet for reference.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://wiki.splunk.com/images/2/2b/Cheatsheet.pdf"&gt;http://wiki.splunk.com/images/2/2b/Cheatsheet.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://krijnhoetmer.nl/stuff/regex/cheat-sheet/"&gt;http://krijnhoetmer.nl/stuff/regex/cheat-sheet/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2014 18:22:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-multiple-strings-of-text-using-rex/m-p/185720#M53513</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-02T18:22:36Z</dc:date>
    </item>
  </channel>
</rss>

