<?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: Need help on rex in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Need-help-on-rex/m-p/697362#M10274</link>
    <description>&lt;P&gt;What do you mean by "it's not working"? It's supposed to work on contents of a given field. This field must be extracted before you use the rex command. Is it extracted?&lt;/P&gt;</description>
    <pubDate>Mon, 26 Aug 2024 19:57:22 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-08-26T19:57:22Z</dc:date>
    <item>
      <title>Need help on rex</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Need-help-on-rex/m-p/697185#M10265</link>
      <description>&lt;P&gt;We have json logs, from the below logs we need to get the rex for the failures count which is mentioned in the logs like (7 failures)&lt;BR /&gt;We need rex to get the count for failures&amp;nbsp; count.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"attributes": {"type" : "rar_Log__c",  "url": "/data/log/v4.0/subject/rar"},  "Application_Id__c": "MOT-Branch", "Category__c": "MOT-Branch", "Comment__c": "Class Name: MOT_Date3DayPurgeBatch - LCT Declined or Not Funded applications deletion completed 3 batches with 3 failures.3",  "Contact_Id__c": null,  "CreatedById" : 657856MHQA,  "CreatedDate": "2022-02-21T16:04:01.000+0000", "Description__c": null}

{"attributes": {"type" : "rar_Log__c",  "url": "/data/log/v4.0/subject/rar"},  "Application_Id__c": "MOT-Branch", "Category__c": "MOT-Branch", "Comment__c": "Class Name: MOT_Date3DayPurgeBatch - LCT Declined or Not Funded applications deletion completed 4 batches with 4 failures.4",  "Contact_Id__c": null,  "CreatedById" : 657856MHQA,  "CreatedDate": "2022-02-21T16:04:01.000+0000", "Description__c": null}

{"attributes": {"type" : "rar_Log__c",  "url": "/data/log/v4.0/subject/rar"},  "Application_Id__c": "MOT-Branch", "Category__c": "MOT-Branch", "Comment__c": "Class Name: MOT_Date3DayPurgeBatch - LCT Declined or Not Funded applications deletion completed 5 batches with 5 failures.5",  "Contact_Id__c": null,  "CreatedById" : 657856MHQA,  "CreatedDate": "2022-02-21T16:04:01.000+0000", "Description__c": null}

{"attributes": {"type" : "rar_Log__c",  "url": "/data/log/v4.0/subject/rar"},  "Application_Id__c": "MOT-Branch", "Category__c": "MOT-Branch", "Comment__c": "Class Name: MOT_Date3DayPurgeBatch - LCT Declined or Not Funded applications deletion completed 7 batches with 7 failures.7",  "Contact_Id__c": null,  "CreatedById" : 657856MHQA,  "CreatedDate": "2022-02-21T16:04:01.000+0000", "Description__c": null}

{"attributes": {"type" : "rar_Log__c",  "url": "/data/log/v4.0/subject/rar"},  "Application_Id__c": "MOT-Branch", "Category__c": "MOT-Branch", "Comment__c": "Class Name: MOT_Date3DayPurgeBatch - LCT Declined or Not Funded applications deletion completed 10 batches with 10 failures.10",  "Contact_Id__c": null,  "CreatedById" : 657856MHQA,  "CreatedDate": "2022-02-21T16:04:01.000+0000", "Description__c": null}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 21:48:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Need-help-on-rex/m-p/697185#M10265</guid>
      <dc:creator>Ram2</dc:creator>
      <dc:date>2024-08-23T21:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on rex</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Need-help-on-rex/m-p/697189#M10266</link>
      <description>&lt;P&gt;Do you need to do this in SPL during search or are you trying to define a field extraction?&lt;/P&gt;&lt;P&gt;Anyway, the usual answer to "regex" and "json" in one sentence is usually "don't fiddle with regex on structured data".&lt;/P&gt;&lt;P&gt;WIth SPL it's relatively easy - extract your fields either with KV_MODE=json or explicitly using spath and do&lt;/P&gt;&lt;PRE&gt;| rex input=attributes.Comment__c "with (?&amp;lt;failures_no&amp;gt;\d+) failures"&lt;/PRE&gt;&lt;P&gt;With field extraction it might not be that easy because transforms which you could call on a json-extracted field are called &lt;EM&gt;before&lt;/EM&gt; autoextractions. So you might actually need to define extraction based on raw data with that regex but that will be unintuitive to maintain since your data seems to be a well-formed json and&amp;nbsp; with json you'd actually expect the explicitly named fields, not some funky stuff pulled from somewhere from the middle.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 22:25:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Need-help-on-rex/m-p/697189#M10266</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-08-23T22:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on rex</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Need-help-on-rex/m-p/697360#M10273</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;our requirement is to set up alert on this logs and we need to trigger an alert if any failures are there greater than 0&lt;/P&gt;&lt;P&gt;I tied the rex u provided it’s not working, as u suggested may I know how can we do via spath&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 19:36:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Need-help-on-rex/m-p/697360#M10273</guid>
      <dc:creator>Ram2</dc:creator>
      <dc:date>2024-08-26T19:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on rex</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Need-help-on-rex/m-p/697362#M10274</link>
      <description>&lt;P&gt;What do you mean by "it's not working"? It's supposed to work on contents of a given field. This field must be extracted before you use the rex command. Is it extracted?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 19:57:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Need-help-on-rex/m-p/697362#M10274</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-08-26T19:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on rex</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Need-help-on-rex/m-p/697483#M10275</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;You can extract a rex of all failures.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| rex field =_raw ".?failures&amp;lt;field name&amp;gt;.\w " &lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Aug 2024 15:47:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Need-help-on-rex/m-p/697483#M10275</guid>
      <dc:creator>alizarei</dc:creator>
      <dc:date>2024-08-27T15:47:04Z</dc:date>
    </item>
  </channel>
</rss>

