<?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 How to extract the whole string based on substring? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-whole-string-based-on-substring/m-p/593601#M206612</link>
    <description>&lt;P&gt;I have a record that results because it matches a particular sub string. Now, I want to extract the whole string the substring is part of.&lt;BR /&gt;For ex. I give&amp;nbsp;&lt;EM&gt;process completed&amp;nbsp;&lt;/EM&gt;as the sub string with my query which results in a record. This record has&amp;nbsp;&lt;EM&gt;Takeover process completed with 390 files&lt;/EM&gt;. Now, I want to get the whole&amp;nbsp;&lt;EM&gt;Takeover process completed with 390 files&amp;nbsp;&lt;/EM&gt;string. How do I do this? Can somebody please help.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Apr 2022 15:16:22 GMT</pubDate>
    <dc:creator>vastav_n</dc:creator>
    <dc:date>2022-04-13T15:16:22Z</dc:date>
    <item>
      <title>How to extract the whole string based on substring?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-whole-string-based-on-substring/m-p/593601#M206612</link>
      <description>&lt;P&gt;I have a record that results because it matches a particular sub string. Now, I want to extract the whole string the substring is part of.&lt;BR /&gt;For ex. I give&amp;nbsp;&lt;EM&gt;process completed&amp;nbsp;&lt;/EM&gt;as the sub string with my query which results in a record. This record has&amp;nbsp;&lt;EM&gt;Takeover process completed with 390 files&lt;/EM&gt;. Now, I want to get the whole&amp;nbsp;&lt;EM&gt;Takeover process completed with 390 files&amp;nbsp;&lt;/EM&gt;string. How do I do this? Can somebody please help.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 15:16:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-whole-string-based-on-substring/m-p/593601#M206612</guid>
      <dc:creator>vastav_n</dc:creator>
      <dc:date>2022-04-13T15:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the whole string based on substring?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-whole-string-based-on-substring/m-p/593623#M206618</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244865"&gt;@vastav_n&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;you want to perform a search using a string (e.g. "travel"),&lt;/LI&gt;&lt;LI&gt;then you want to display all the field containing the string.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Is it correct?&lt;/P&gt;&lt;P&gt;this is possible if you have the message to display in a field (called e.g. "message") and running something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search "travel"
| eval check=if(like(message,"%travel%"),"yes","not")
| search check="yes"
| table _time message&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 15:30:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-whole-string-based-on-substring/m-p/593623#M206618</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-04-13T15:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the whole string based on substring?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-whole-string-based-on-substring/m-p/593643#M206629</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt; ,&amp;nbsp;thanks for replying.&amp;nbsp;&lt;BR /&gt;Yes, you understood my issue correctly. Actually this is almost the same solution I have right now. The only issue is I have multiple&amp;nbsp;&lt;EM&gt;message&amp;nbsp;&lt;/EM&gt;fields, and if I run this it gives me the string of the first occurrence of&amp;nbsp;&lt;EM&gt;message&lt;/EM&gt; instead of the &lt;EM&gt;message&amp;nbsp;&lt;/EM&gt; which matches my sub-string.&lt;BR /&gt;For ex. this is how my event looks like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;time=2022-04-13T07:00:34,276Z traceName= correlationId= level=INFO logger=PortfolioFetcher message="Calling" source="TakeOver/file3"
time=2022-04-13T07:00:34,278Z traceName= correlationId= level=INFO logger=PortfolioFetcher message="Calling" source="TakeOver/file5"
time=2022-04-13T07:00:34,281Z traceName= correlationId= level=INFO logger=PortfolioFetcher message="Calling" source="TakeOver/file2"
time=2022-04-13T07:00:35,213Z traceName= correlationId= level=INFO logger=DataFetcher message="Takeover process completed with 390_38 files" source="TakeOver/file1"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/EM&gt;Now, I want to use sub string &lt;EM&gt;"process completed"&lt;/EM&gt; to get string&amp;nbsp; &lt;EM&gt;"Takeover process completed with 390_38 files" .&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;If you could help with this, that would be really awesome of you!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 16:08:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-whole-string-based-on-substring/m-p/593643#M206629</guid>
      <dc:creator>vastav_n</dc:creator>
      <dc:date>2022-04-13T16:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the whole string based on substring?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-whole-string-based-on-substring/m-p/593721#M206661</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244865"&gt;@vastav_n&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: the samples you shared are different events, is it correct?&lt;/P&gt;&lt;P&gt;do you want to display all events or only the one matching the "process completed" string?&lt;/P&gt;&lt;P&gt;if only the matching string, my solution should work for you:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search "travel"
| eval check=if(like(message,"%process completed%"),"yes","not")
| search check="yes"
| table _time message&lt;/LI-CODE&gt;&lt;P&gt;what is the result of my search?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 06:34:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-whole-string-based-on-substring/m-p/593721#M206661</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-04-14T06:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the whole string based on substring?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-whole-string-based-on-substring/m-p/593726#M206665</link>
      <description>&lt;P&gt;The easiest thing to do is to just search for "process completed". As simple as that. In case you want to match this only to a particular field, you could use a more tricky method (it should be more effective than simple wildcard search due to the way splunk works)&lt;/P&gt;&lt;PRE&gt;"process completed" | search field="*process completed*"&lt;/PRE&gt;&lt;P&gt;or something like that.&lt;/P&gt;&lt;P&gt;But the question is if that's what you mean.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 07:03:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-whole-string-based-on-substring/m-p/593726#M206665</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-04-14T07:03:04Z</dc:date>
    </item>
  </channel>
</rss>

