<?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: To extract fields in the data model in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625102#M14885</link>
    <description>&lt;P&gt;The trick to getting fields extracted by a data model is to use the CIM name for the fields, in this case file_name and file_path.&amp;nbsp; Also, the fields must be extracted automatically rather than in a search.&amp;nbsp; Add EXTRACT or FIELDALIAS settings to the appropriate props.conf file.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[mysourcetype]
EXTRACT-file_name = "fileName": "(?&amp;lt;file_name&amp;gt;[^"]+)
EXTRACT-file_path = "filePath": "(?&amp;lt;file_path&amp;gt;[^"]+)&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 22 Dec 2022 15:42:39 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-12-22T15:42:39Z</dc:date>
    <item>
      <title>How to extract fields in the data model?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/624991#M14873</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm new to the regex, can someone please help me in regex to extract file name and file path separately in the data model.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Field value is variable in the fields file name and file path. Thank you.&lt;/P&gt;
&lt;P&gt;Below is the sample data.&lt;/P&gt;
&lt;P&gt;"evidence": [{"entityType": "File", "evidenceCreation Time": "2022-12-19T10:43:56.51Z", "sha1": "336466254f9fe9b5a09f27848317525481dd5dd6", "sha256": "59de220b8d7961086e8d2d1fde61b71a810a32f78a9175f1f87ecacd692b85c9", "fileName": "Nero-8.1.1.0b_fra_trial.exe", "filePath": "F:\\Desktop new backup\\Musique \\Nero 8", "processId": null, "process CommandLine": null, "processCreation Time": null, "parentProcessId":&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 15:03:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/624991#M14873</guid>
      <dc:creator>Daksesh</dc:creator>
      <dc:date>2022-12-21T15:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: To extract fields in the data model</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/624997#M14874</link>
      <description>&lt;P&gt;What do you mean by "in the data model"?&amp;nbsp; Which data model?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a simple matter to use rex to extract the file name and path fields from the raw event since each has a distinct eye-catcher.&amp;nbsp; All you need is a regex that looks for '"fileName": "' or '"filePath": "' and takes everything until the next quotation mark as the field value.&amp;nbsp; Those regex strings would be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"fileName": "(?&amp;lt;fileName&amp;gt;[^"]+)
"filePath": "(?&amp;lt;filePath&amp;gt;[^"]+)&lt;/LI-CODE&gt;&lt;P&gt;Use them in a search by escaping the quotation marks (yes 3 backslashes are needed).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\\\"fileName\\\": \\\"(?&amp;lt;fileName&amp;gt;[^\\\"]+)"
| rex "\\\"filePath\\\": \\\"(?&amp;lt;filePath&amp;gt;[^\\\"]+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 21 Dec 2022 15:02:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/624997#M14874</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-12-21T15:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: To extract fields in the data model</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625101#M14884</link>
      <description>&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;Thank you for answer.&lt;/P&gt;&lt;P&gt;When I run the regex for both file name and file path in the search extraction is happening. But extraction is not happening in the Endpoint data model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me if any changes are required in the regex for Endpoint datamodel.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 15:13:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625101#M14884</guid>
      <dc:creator>Daksesh</dc:creator>
      <dc:date>2022-12-22T15:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: To extract fields in the data model</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625102#M14885</link>
      <description>&lt;P&gt;The trick to getting fields extracted by a data model is to use the CIM name for the fields, in this case file_name and file_path.&amp;nbsp; Also, the fields must be extracted automatically rather than in a search.&amp;nbsp; Add EXTRACT or FIELDALIAS settings to the appropriate props.conf file.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[mysourcetype]
EXTRACT-file_name = "fileName": "(?&amp;lt;file_name&amp;gt;[^"]+)
EXTRACT-file_path = "filePath": "(?&amp;lt;file_path&amp;gt;[^"]+)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 22 Dec 2022 15:42:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625102#M14885</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-12-22T15:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: To extract fields in the data model</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625250#M14892</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;I would like to have double check that, below regex to be included in the add on(Splunk_TA_MS_Security) or in the CIM addon.&lt;/P&gt;&lt;P&gt;The logs are being onboarding by using the add on&amp;nbsp;Splunk_TA_MS_Security, so I bit confused where exactly regex requires either in&amp;nbsp;Splunk_TA_MS_Security or&amp;nbsp;&lt;SPAN&gt;Splunk Common Information Model addon.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Could you please support for the above query.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 08:12:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625250#M14892</guid>
      <dc:creator>Daksesh</dc:creator>
      <dc:date>2022-12-26T08:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: To extract fields in the data model</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625279#M14893</link>
      <description>&lt;P&gt;The regexes can go in any app because Splunk will combine the settings for a given sourcetype from all apps, subject to sharing level.&amp;nbsp; It may make the most sense to put them in a custom app or in&amp;nbsp;&lt;SPAN&gt;Splunk_TA_MS_Security, but not in the CIM add-on.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 17:01:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625279#M14893</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-12-26T17:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: To extract fields in the data model</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625319#M14896</link>
      <description>&lt;P&gt;The | rex command obviously works only in the time of your specific search containing that command. So the fields will not be extracted otherwise.&lt;/P&gt;&lt;P&gt;In this case however it seems that your event is a json structure so maybe it would be better to use automatic json KV extraction. Now the only part would be to get the data to conform to the CIM-defined schema by defining proper aliases and/or calculated fields for your particular sourcetype.&lt;/P&gt;&lt;P&gt;In other words - you &lt;U&gt;don't&lt;/U&gt; modify the CIM-supplied datamodels because they are the standard that other apps follow but you apply modifications on your own sourcetype to make it compliant with CIM-datamodel&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2022 10:34:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625319#M14896</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-12-27T10:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: To extract fields in the data model</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625409#M14903</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your clear explanation and support.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 11:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625409#M14903</guid>
      <dc:creator>Daksesh</dc:creator>
      <dc:date>2022-12-28T11:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: To extract fields in the data model</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625410#M14904</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your clear explanation and support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 11:26:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625410#M14904</guid>
      <dc:creator>Daksesh</dc:creator>
      <dc:date>2022-12-28T11:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: To extract fields in the data model</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625420#M14906</link>
      <description>&lt;P&gt;If your problem is resolved, then please click the "Accept as Solution" button to help future readers.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 14:38:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-extract-fields-in-the-data-model/m-p/625420#M14906</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-12-28T14:38:08Z</dc:date>
    </item>
  </channel>
</rss>

