<?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: Would you create rex or regex to extract a string and create a new field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411805#M118757</link>
    <description>&lt;P&gt;If there is more data after page: then use this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"action":"(?&amp;lt;test&amp;gt;\w+|.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will grab everything inside the quotes&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jun 2018 22:32:25 GMT</pubDate>
    <dc:creator>hos_2</dc:creator>
    <dc:date>2018-06-27T22:32:25Z</dc:date>
    <item>
      <title>Would you create rex or regex to extract a string and create a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411801#M118753</link>
      <description>&lt;P&gt;I have the raw data below.  How do I get the strings after the "action": and put all the results into a new field?   &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"dateTime":"2018-03-19T05:57:46.3002859Z","ID":"b3f7","account":"9002",xd":"859","action":"Exit"}
{"dateTime":"2018-03-19T05:57:47.1102859Z","ID":"cbbf","account":"f295",xd":"f89","tile":"HeroTile","action":"page:http://first.com/roomV8.2/front.main/"}

{"dateTime":"2018-03-19T05:57:46.3002859Z","ID":"b3f7","account":"9002",xd":"859","action":"Exit"}
{"dateTime":"2018-03-19T05:57:47.1102859Z","ID":"cbbf","account":"f295",xd":"f89","tile":"HeroTile","action":"page:http://second.com/roomV8.2/front.main/"}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Jun 2018 21:20:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411801#M118753</guid>
      <dc:creator>dwong2</dc:creator>
      <dc:date>2018-06-27T21:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Would you create rex or regex to extract a string and create a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411802#M118754</link>
      <description>&lt;P&gt;Hi dwong2,&lt;/P&gt;

&lt;P&gt;Try it in &lt;A href="https://regex101.com/"&gt;https://regex101.com/&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"action":"(?&amp;lt;test&amp;gt;\w+|.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Basically you want to tell regex to search for "Action" and group any of the results into a field we can call on later, which in this example I named "test".&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 21:58:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411802#M118754</guid>
      <dc:creator>hos_2</dc:creator>
      <dc:date>2018-06-27T21:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Would you create rex or regex to extract a string and create a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411803#M118755</link>
      <description>&lt;P&gt;Did you miss a quote after &lt;CODE&gt;"page:&lt;/CODE&gt;?&lt;BR /&gt;
Can you show what's after &lt;CODE&gt;page:&lt;/CODE&gt;? can action have multiple values separated by &lt;CODE&gt;:&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 22:06:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411803#M118755</guid>
      <dc:creator>amiftah</dc:creator>
      <dc:date>2018-06-27T22:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Would you create rex or regex to extract a string and create a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411804#M118756</link>
      <description>&lt;P&gt;Is there a way to convert the &lt;CODE&gt;:&lt;/CODE&gt; to &lt;CODE&gt;=&lt;/CODE&gt; in the log file?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 22:27:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411804#M118756</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2018-06-27T22:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Would you create rex or regex to extract a string and create a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411805#M118757</link>
      <description>&lt;P&gt;If there is more data after page: then use this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"action":"(?&amp;lt;test&amp;gt;\w+|.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will grab everything inside the quotes&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 22:32:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411805#M118757</guid>
      <dc:creator>hos_2</dc:creator>
      <dc:date>2018-06-27T22:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Would you create rex or regex to extract a string and create a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411806#M118758</link>
      <description>&lt;P&gt;If i wanted to search for this instead "action":"page:  ?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 22:43:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411806#M118758</guid>
      <dc:creator>dwong2</dc:creator>
      <dc:date>2018-06-27T22:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Would you create rex or regex to extract a string and create a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411807#M118759</link>
      <description>&lt;P&gt;@ddrillic you can use the sed command to replace &lt;CODE&gt;:&lt;/CODE&gt; by &lt;CODE&gt;=&lt;/CODE&gt; :&lt;BR /&gt;
&lt;CODE&gt;| rex field=_raw mode=sed "s/:/=/g"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 01:28:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411807#M118759</guid>
      <dc:creator>amiftah</dc:creator>
      <dc:date>2018-06-28T01:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Would you create rex or regex to extract a string and create a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411808#M118760</link>
      <description>&lt;P&gt;So, great, we can replace the &lt;CODE&gt;:&lt;/CODE&gt; with &lt;CODE&gt;=&lt;/CODE&gt; and then the fields should be automatically detected. &lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 13:56:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411808#M118760</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2018-06-28T13:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Would you create rex or regex to extract a string and create a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411809#M118761</link>
      <description>&lt;P&gt;This will work much better and faster then my previous regex.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 17:00:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411809#M118761</guid>
      <dc:creator>hos_2</dc:creator>
      <dc:date>2018-06-28T17:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Would you create rex or regex to extract a string and create a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411810#M118762</link>
      <description>&lt;P&gt;Add this to your search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my index  |rex field=source "\"action\":\"(?&amp;lt;action&amp;gt;[^\"]+)" |  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you don't want to get the action=Exit   let me know &lt;/P&gt;</description>
      <pubDate>Fri, 20 Jul 2018 17:43:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411810#M118762</guid>
      <dc:creator>j_cabanillas</dc:creator>
      <dc:date>2018-07-20T17:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Would you create rex or regex to extract a string and create a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411811#M118763</link>
      <description>&lt;P&gt;you can do the same for other fields constants like  dateTime ID account &lt;/P&gt;</description>
      <pubDate>Fri, 20 Jul 2018 17:46:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Would-you-create-rex-or-regex-to-extract-a-string-and-create-a/m-p/411811#M118763</guid>
      <dc:creator>j_cabanillas</dc:creator>
      <dc:date>2018-07-20T17:46:28Z</dc:date>
    </item>
  </channel>
</rss>

