<?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: Two different Deliminator for a field in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215076#M42336</link>
    <description>&lt;P&gt;Hi AdixitSplunk,&lt;BR /&gt;
why you don't use a regex extraction like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "(:|for)\s(?&amp;lt;Message&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jan 2017 12:22:04 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2017-01-05T12:22:04Z</dc:date>
    <item>
      <title>Two different Deliminator for a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215071#M42331</link>
      <description>&lt;P&gt;I have 2 types of Messages in my log&lt;BR /&gt;
for 1st i want to split it from ":" deliminator &lt;BR /&gt;
and for 2nd i want deliminator to be "for"&lt;/P&gt;

&lt;P&gt;my base query is  something like belwo :&lt;/P&gt;

&lt;P&gt;.... Message1 OR Message2|&lt;STRONG&gt;eval delim=(if Message1, deliminator should be ":"  ,if Message2 ,deliminator should be "for"| eval num=split(Message,"delim")&lt;/STRONG&gt;|eval field=mvindex(num,0)|stats count by field &lt;/P&gt;

&lt;P&gt;Please help me on this .&lt;/P&gt;

&lt;P&gt;Thanks &lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 10:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215071#M42331</guid>
      <dc:creator>AdixitSplunk</dc:creator>
      <dc:date>2017-01-05T10:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Two different Deliminator for a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215072#M42332</link>
      <description>&lt;P&gt;Do you have some sample data? Are message1 and message2 text strings or field names? Are they in a field or do you need to extract from raw?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 10:57:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215072#M42332</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2017-01-05T10:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Two different Deliminator for a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215073#M42333</link>
      <description>&lt;P&gt;Field name is Message.From Message1 and 2 i means to say different type of message.&lt;BR /&gt;
So there are basically 2 types of Messages in field Message&lt;BR /&gt;
Example :&lt;BR /&gt;
1st  Applicatio photobuf message &lt;STRONG&gt;:&lt;/STRONG&gt; dfgjsdgfjsgd gsdkgfksdgf ksdgfksdgfk s--- for such message i want ":" as delim&lt;BR /&gt;
2nd  Application2:Photoinserted to somesets &lt;STRONG&gt;for&lt;/STRONG&gt; an Account--- for these messages i want "for" as delim&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 11:01:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215073#M42333</guid>
      <dc:creator>AdixitSplunk</dc:creator>
      <dc:date>2017-01-05T11:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Two different Deliminator for a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215074#M42334</link>
      <description>&lt;P&gt;Use match or like inside if condition to find message type based on that set the delim.&lt;/P&gt;

&lt;P&gt;..| eval delim = if(like(_raw,"%:%"),":","for")&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 11:10:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215074#M42334</guid>
      <dc:creator>Arun_N_007</dc:creator>
      <dc:date>2017-01-05T11:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Two different Deliminator for a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215075#M42335</link>
      <description>&lt;P&gt;can you please help me with the syntax here .&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 12:06:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215075#M42335</guid>
      <dc:creator>AdixitSplunk</dc:creator>
      <dc:date>2017-01-05T12:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Two different Deliminator for a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215076#M42336</link>
      <description>&lt;P&gt;Hi AdixitSplunk,&lt;BR /&gt;
why you don't use a regex extraction like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "(:|for)\s(?&amp;lt;Message&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 12:22:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215076#M42336</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-01-05T12:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Two different Deliminator for a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215077#M42337</link>
      <description>&lt;P&gt;Its not working &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; , its only showing the last &lt;BR /&gt;
Message are like :&lt;BR /&gt;
Application photobuf message : dhfksdhkfhksdhfk hdfkshfskhfk dfhkshdfkshfhs&lt;BR /&gt;
Application Data loaded successfully for Photo No - 123456789 ; OrderIPlaceno - 987654321 &lt;/P&gt;

&lt;P&gt;using  | rex "(:|for)\s(?.&lt;EM&gt;)" is giving Photo No -1234&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 12:54:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215077#M42337</guid>
      <dc:creator>AdixitSplunk</dc:creator>
      <dc:date>2017-01-05T12:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: Two different Deliminator for a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215078#M42338</link>
      <description>&lt;P&gt;modify regex &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex max_match=0 "(:|for)\s(?&amp;lt;Message&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;see &lt;A href="https://regex101.com/r/nGhrLA/1"&gt;https://regex101.com/r/nGhrLA/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 14:19:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215078#M42338</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-01-05T14:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Two different Deliminator for a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215079#M42339</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... Message1 OR Message2|eval delim=if(searchmatch("Message1"),split(Message,":"),split(Message,"for"))|eval field=mvindex(num,0)|stats count by field
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Jan 2017 16:08:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215079#M42339</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-01-05T16:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Two different Deliminator for a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215080#M42340</link>
      <description>&lt;P&gt;How about you try this and take whichever one you are interested in out of &lt;CODE&gt;preFix&lt;/CODE&gt; OR &lt;CODE&gt;sufFix&lt;/CODE&gt; fields if your initial string is in field &lt;CODE&gt;Message&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your query to return events
| rex field=Message "^(?&amp;lt;preFix&amp;gt;^.*?)(\s:\s|\sfor\s)(?&amp;lt;sufFix&amp;gt;.*)"
| table preFix, sufFix, Message
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/rtTePn/1"&gt;See here for the extraction at work. Notice the &lt;CODE&gt;Group PreFix&lt;/CODE&gt; and &lt;CODE&gt;Group SufFix&lt;/CODE&gt; on right sidebar after reaching the extraction hyperlink page.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 16:26:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215080#M42340</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2017-01-05T16:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Two different Deliminator for a field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215081#M42341</link>
      <description>&lt;P&gt;|stats count|eval _raw="Application photobuf message : dhfksdhkfhksdhfk hdfkshfskhfk dfhkshdfkshfhs"|append [|stats count|eval _raw="Application Data loaded successfully for Photo No - 123456789 ; OrderIPlaceno - 987654321"]| eval delim = if(like(_raw,"%:%"),":","for")|eval _raw=split(_raw,delim)|eval split1=mvindex(_raw,0)|eval split2=mvindex(_raw,1)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:18:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Two-different-Deliminator-for-a-field/m-p/215081#M42341</guid>
      <dc:creator>Arun_N_007</dc:creator>
      <dc:date>2020-09-29T12:18:36Z</dc:date>
    </item>
  </channel>
</rss>

