<?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: rex help... in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701921#M238050</link>
    <description>&lt;LI-CODE lang="markup"&gt;| rex "\"policyId\":\"(?&amp;lt;policyId&amp;gt;\w+)\""&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 15 Oct 2024 12:16:20 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2024-10-15T12:16:20Z</dc:date>
    <item>
      <title>rex help...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701875#M238042</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;
&lt;P&gt;Please help!!&lt;/P&gt;
&lt;P&gt;I need to extract the ID value from the two events below, and I’m kinda banging my head here… . I just need to list Q123456789 and each ID in my dashboard. But it I can’t get past all of the special characters.&lt;/P&gt;
&lt;P&gt;I’ve tried using different combinations like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval msg=”the event”

| rex "msg =(?&amp;lt; policyId &amp;gt;\w+)”

| table policyId&lt;/LI-CODE&gt;
&lt;P&gt;But what I would really like to have something like this in my dashboard:&lt;/P&gt;
&lt;P&gt;Starting Controller Q123456789&lt;/P&gt;
&lt;P&gt;CallStatus=Success Q123456789&lt;/P&gt;
&lt;P&gt;Starting Controller Q123456788&lt;/P&gt;
&lt;P&gt;CallStatus=Success Q123456788&lt;/P&gt;
&lt;P&gt;Starting Controller Q123456787&lt;/P&gt;
&lt;P&gt;CallStatus=Success Q123456787&lt;/P&gt;
&lt;P&gt;And so on.&lt;/P&gt;
&lt;P&gt;Is this possible?&lt;/P&gt;
&lt;P&gt;Your help is always appreciated.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Starting Controller=Fall Action=GetFallReportAssessment data={"policyId":"Q123456789","inceptionDate":"20250501","postDate":"1900-01-01T12:00:00"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;API=/api/Fall/reportAssessment/ CallStatus=Success Controller=Fall Action=GetFallReportAssessment Duration=27 data={"policyId":"Q123456789","inceptionDate":"20250501","postDate":"1900-01-01T12:00:00"}&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 18:06:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701875#M238042</guid>
      <dc:creator>msarkaus</dc:creator>
      <dc:date>2024-10-15T18:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: rex help...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701921#M238050</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex "\"policyId\":\"(?&amp;lt;policyId&amp;gt;\w+)\""&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 15 Oct 2024 12:16:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701921#M238050</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-10-15T12:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: rex help...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701924#M238053</link>
      <description>&lt;P&gt;Regular expressions are very literal - they match exactly what they are told to match or they don't match at all.&amp;nbsp; In the attempted SPL, the &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command expects to find the letters 'm', 's',&amp;nbsp; 'g', a space, and '=' in that order, but they are not present in the sample events so no policyId field can be extracted.&amp;nbsp; Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=msg "policyId\\\":\\\"(?&amp;lt;policyId&amp;gt;\w+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 12:27:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701924#M238053</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-10-15T12:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: rex help...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701934#M238057</link>
      <description>&lt;P&gt;Unfortunately, it didn't pick up the policy ID.&amp;nbsp; It returns a blank table&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 12:59:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701934#M238057</guid>
      <dc:creator>msarkaus</dc:creator>
      <dc:date>2024-10-15T12:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: rex help...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701936#M238059</link>
      <description>&lt;P&gt;It returns a blank table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 13:03:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701936#M238059</guid>
      <dc:creator>msarkaus</dc:creator>
      <dc:date>2024-10-15T13:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: rex help...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701937#M238060</link>
      <description>&lt;P&gt;If the rex isn't working, it is probably because it doesn't match precisely to the event you have. Please repost your events in a code block &amp;lt;/&amp;gt; to preserve the formatting which will be important to getting the rex correct.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 13:06:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701937#M238060</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-10-15T13:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: rex help...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701943#M238063</link>
      <description>&lt;P&gt;&amp;lt;/&lt;SPAN&gt;&lt;EM&gt;API=/api/full/reportAssessment/ CallStatus=Success Controller=Full Action=GetfullReportAssessment Duration=5 data={"policyId":"Q123456789","inceptionDate":"20241015","postDate":"1900-01-01T12:00:00"}&lt;/EM&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;/&lt;EM&gt;Starting Controller=Full Action=GetClueReportAssessment data={"policyId":"Q123456789","inceptionDate":"20241015","postDate":"1900-01-01T12:00:00"}&lt;/EM&gt;/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 13:24:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701943#M238063</guid>
      <dc:creator>msarkaus</dc:creator>
      <dc:date>2024-10-15T13:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: rex help...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701945#M238065</link>
      <description>&lt;P&gt;This is a code block&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;/API=/api/full/reportAssessment/ CallStatus=Success Controller=Full Action=GetfullReportAssessment Duration=5 data={"policyId":"Q123456789","inceptionDate":"20241015","postDate":"1900-01-01T12:00:00"}&amp;gt;

 

&amp;lt;/Starting Controller=Full Action=GetClueReportAssessment data={"policyId":"Q123456789","inceptionDate":"20241015","postDate":"1900-01-01T12:00:00"}/&lt;/LI-CODE&gt;&lt;P&gt;The rex pattern provided would extract the policyId from this so there is probably something different about the event as you have shown it and your actual events. If you don't provide accurate (enough) information, we will not be able to provide you with an accurate (enough) solution.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 13:32:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701945#M238065</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-10-15T13:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: rex help...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701961#M238072</link>
      <description>&lt;P&gt;Please share the full SPL you ran.&amp;nbsp; The one command I provided will not return a table so we need to know how you are creating a table.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 14:09:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701961#M238072</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-10-15T14:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: rex help...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701972#M238074</link>
      <description>&lt;P&gt;Sorry.... I'm going to need to combine the policyid for both logs into one.&amp;nbsp; Both do not work..&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your help..&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Call out&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/&lt;/P&gt;&lt;P&gt;index=xxx appSubLvlNam="QAA" (msgTxt="Starting Controller=Full Action=GetFullReportAssessment data*" OR msgTxt="API=/api/full/reportAssessment/ CallStatus=Success*")&lt;/P&gt;&lt;P&gt;| eval msgTxt "Starting Controller=Full Action=GetFullReportAssessment data={"policyId":"Q123456789","inceptionDate":"20241011","postDate":"1900-01-01T12:00:00"}"&lt;/P&gt;&lt;P&gt;| rex "\"policyId\":\"(?&amp;lt;policyId&amp;gt;\w+)\""&lt;/P&gt;&lt;P&gt;| table policyId&lt;/P&gt;&lt;P&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Response&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/&lt;/P&gt;&lt;P&gt;index=xxx appSubLvlNam="QAA" (msgTxt="Starting Controller=Full Action=GetFullReportAssessment data*" OR msgTxt="API=/api/full/reportAssessment/ CallStatus=Success*")&lt;/P&gt;&lt;P&gt;| eval msgTxt "API=/api/full/reportAssessment/ CallStatus=Success Controller=full Action=GetFullReportAssessment Duration=17 data={"policyId":"Q123456789","inceptionDate":"20241015","postDate":"1900-01-01T12:00:00"} "&lt;/P&gt;&lt;P&gt;| rex "\"policyId\":\"(?&amp;lt;policyId&amp;gt;\w+)\""&lt;/P&gt;&lt;P&gt;| table policyId&lt;/P&gt;&lt;P&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 15:59:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701972#M238074</guid>
      <dc:creator>msarkaus</dc:creator>
      <dc:date>2024-10-15T15:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: rex help...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701974#M238075</link>
      <description>&lt;P&gt;You need to provide your raw event in a code block - use this button&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITWhisperer_0-1729008984590.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/33108i79FE5EFA7319A90D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITWhisperer_0-1729008984590.png" alt="ITWhisperer_0-1729008984590.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;to open a code block and paste your raw event into it so we can see exactly what you are dealing with&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 16:17:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-help/m-p/701974#M238075</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-10-15T16:17:11Z</dc:date>
    </item>
  </channel>
</rss>

