<?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: Query Rex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Query-Rex/m-p/576518#M200912</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;awesome thank you, this has saved me so much time.&amp;nbsp; it is producing what i need now albeit there are some anomalies in the data but i know what to do from here...thank you so much&lt;/P&gt;</description>
    <pubDate>Sun, 28 Nov 2021 09:45:18 GMT</pubDate>
    <dc:creator>StepneyGeezer</dc:creator>
    <dc:date>2021-11-28T09:45:18Z</dc:date>
    <item>
      <title>Query Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-Rex/m-p/576512#M200907</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am a newbie and am looking to extract data from a sample set that looks like this (its ingested in JSON):&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;level&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class=""&gt;info&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;log&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class=""&gt;uid="302650",&amp;nbsp; a_msg="HandlingStatus=Finished, Message=&lt;STRONG&gt;Changed&lt;/STRONG&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;log_type&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class=""&gt;containerlogs&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;stream&lt;/SPAN&gt;:&amp;nbsp;&lt;SPAN class=""&gt;stdout&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to extract the uid data as well as the Message which is inside the a_msg.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;rex field=log "uid=\"(?&amp;lt;uid&amp;gt;\d{1,}+)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;which gives me the uid, but I am REALLY struggling with the Message, ideally I would like a table to be produced so from the above data it would look like&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;UID, Message&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;302650, PlanChanged&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I am reading up on Rex and Reg Ex etc, but this particular request requires a quick turnaround and i am really struggling.&amp;nbsp; Any help would be appreciated.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Many thanks&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Nov 2021 08:46:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-Rex/m-p/576512#M200907</guid>
      <dc:creator>StepneyGeezer</dc:creator>
      <dc:date>2021-11-28T08:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Query Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-Rex/m-p/576513#M200908</link>
      <description>&lt;P&gt;Please can you share the raw event in a code block &amp;lt;/&amp;gt; rather than a formatted version of the event?&lt;/P&gt;</description>
      <pubDate>Sun, 28 Nov 2021 09:07:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-Rex/m-p/576513#M200908</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-11-28T09:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Query Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-Rex/m-p/576514#M200909</link>
      <description>&lt;LI-CODE lang="markup"&gt;{"log":"a_level=\"INFO\", a_uid=\"302650\", a_msg=\"HandlingStatus=Finished, Message=PlanChanged, MessageId=0c0277da-4b4a-4c4d-abcd-49b8c1e3f896, Result=True\", "level":"info"}&lt;/LI-CODE&gt;&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; - you getting me excited, i have spent ages on this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Nov 2021 09:15:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-Rex/m-p/576514#M200909</guid>
      <dc:creator>StepneyGeezer</dc:creator>
      <dc:date>2021-11-28T09:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Query Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-Rex/m-p/576515#M200910</link>
      <description>&lt;P&gt;No wonder you are struggling - this doesn't look like correctly formatted JSON - the rex you said works, doesn't work with the string you just post since it includes backslashes which are not in the rex you shared. If the backslashes really exist in your data, try something like this (the first part before the blank lines just sets up the data you shared.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="{\"log\":\"a_level=\\\"INFO\\\", a_uid=\\\"302650\\\", a_msg=\\\"HandlingStatus=Finished, Message=PlanChanged, MessageId=0c0277da-4b4a-4c4d-abcd-49b8c1e3f896, Result=True\\\", \"level\":\"info\"}"




| rex "uid=\\\\\"(?&amp;lt;uid&amp;gt;\d+).+Message=(?&amp;lt;message&amp;gt;[^,]+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 28 Nov 2021 09:31:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-Rex/m-p/576515#M200910</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-11-28T09:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Query Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-Rex/m-p/576518#M200912</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;awesome thank you, this has saved me so much time.&amp;nbsp; it is producing what i need now albeit there are some anomalies in the data but i know what to do from here...thank you so much&lt;/P&gt;</description>
      <pubDate>Sun, 28 Nov 2021 09:45:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-Rex/m-p/576518#M200912</guid>
      <dc:creator>StepneyGeezer</dc:creator>
      <dc:date>2021-11-28T09:45:18Z</dc:date>
    </item>
  </channel>
</rss>

