<?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: How to create a regex to capture information from an indexing sourcetype? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278457#M84079</link>
    <description>&lt;P&gt;It will show in interesting fields only if more than 20% of the events have the field. Try the updated regex. Also, the props &amp;amp; transforms need to be on your search head(s)&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2016 17:59:33 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-10-25T17:59:33Z</dc:date>
    <item>
      <title>How to create a regex to capture information from an indexing sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278450#M84072</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm struggling to create a regex to capture all the information correctly from a sourcetype we have and make them into interesting fields. &lt;/P&gt;

&lt;P&gt;The structure of the logs is:&lt;/P&gt;

&lt;P&gt;username: "User1";  companyName: "Company 4";  etc etc &lt;/P&gt;

&lt;P&gt;Where there's no information within the field it remains empty "". &lt;/P&gt;

&lt;P&gt;When trying it doesn't seem to pick up all results &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Please help.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 11:34:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278450#M84072</guid>
      <dc:creator>lukeandrews</dc:creator>
      <dc:date>2016-10-24T11:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regex to capture information from an indexing sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278451#M84073</link>
      <description>&lt;P&gt;Hi Lukeandrews,&lt;/P&gt;

&lt;P&gt;Even I am new to Splunk, but I suggest you can make use of rex command to extract the required information in the Search String.&lt;BR /&gt;
We notice semi-colon marking end of a key-value pair, so we can use something like this : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=ABC index =XYZ sourcetype=PQR |rex field=_raw "username:\"(?&amp;lt;username&amp;gt;\w*)\";" | rex field=_raw "companyName:\"(?&amp;lt;Company&amp;gt;[\w\s]*)\";" .....so on
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If the values ("User1"), are not enclosed in quotations, same can be used as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=ABC index =XYZ sourcetype=PQR |rex field=_raw "username:(?&amp;lt;username&amp;gt;\w*);" | rex field=_raw "companyName:(?&amp;lt;Company&amp;gt;[\w\s]*);" .... so on
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps...:)&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 12:26:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278451#M84073</guid>
      <dc:creator>Honey0308</dc:creator>
      <dc:date>2016-10-24T12:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regex to capture information from an indexing sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278452#M84074</link>
      <description>&lt;P&gt;can you share an example of the log or the regex you've tried?&lt;BR /&gt;
also, regex101.com is an excellent place to try to work it out.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 12:36:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278452#M84074</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2016-10-24T12:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regex to capture information from an indexing sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278453#M84075</link>
      <description>&lt;P&gt;Try these changes to props &amp;amp; transforms&lt;BR /&gt;
*&lt;STRONG&gt;&lt;EM&gt;UPDATED&lt;/EM&gt;&lt;/STRONG&gt;*&lt;BR /&gt;
props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REPORT-extractfields
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[extractfields]
REGEX = (\w+):\s+\"([^"]+)?\"
FORMAT = $1::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Restart Splunk.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 12:37:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278453#M84075</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-24T12:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regex to capture information from an indexing sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278454#M84076</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;username: "(?&amp;lt;username&amp;gt;\w*)";\s+companyName: "(?&amp;lt;companyName&amp;gt;[\w ]*)";
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Oct 2016 12:44:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278454#M84076</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-10-24T12:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regex to capture information from an indexing sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278455#M84077</link>
      <description>&lt;P&gt;action: "DOC_UPLOAD_DOCUMENTS"; username: "zCarrier4User1"; companyName: "zCarrier 4"; consolidationId: "19882"; shipmentReference: "krish-9165"; vessel: "zCarrier4Vessel1"; vesselImo: "1000004"; taskId: "56838"; consignmentId: "29726"; parcelReference: "45-p-3"; consignor: "zTerminal"; consignee: ""; billOfLadingDate: "8 AUG 2016"; cargo: "Barley edited"; quantity: "121,212 Pounds"; loadingLocation: "zWestwego"; destination: "Visakhapatnam INDIA"; freightForwarder: ""; presentee: ""; financeNumber: ""; endorseeCompanyName: "zTerminal"; endorsementStampType: ""; endorsementType: ""; jSessionId: "0F78869A26215A2AC3800D96DE92CDCC"; &lt;/P&gt;

&lt;P&gt;This is an example of what I need to extract. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:35:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278455#M84077</guid>
      <dc:creator>lukeandrews</dc:creator>
      <dc:date>2020-09-29T11:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regex to capture information from an indexing sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278456#M84078</link>
      <description>&lt;P&gt;I tried but it didn't work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Should this automatically add values to my interesting fields? &lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 16:25:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278456#M84078</guid>
      <dc:creator>lukeandrews</dc:creator>
      <dc:date>2016-10-25T16:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a regex to capture information from an indexing sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278457#M84079</link>
      <description>&lt;P&gt;It will show in interesting fields only if more than 20% of the events have the field. Try the updated regex. Also, the props &amp;amp; transforms need to be on your search head(s)&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 17:59:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-regex-to-capture-information-from-an-indexing/m-p/278457#M84079</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-25T17:59:33Z</dc:date>
    </item>
  </channel>
</rss>

