<?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 search a field which contain text from another field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-field-which-contain-text-from-another-field/m-p/529725#M149635</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225056"&gt;@dordavid&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;you have two searches,&lt;/LI&gt;&lt;LI&gt;you want to filter the results of search_1 where a field of search_2 is present.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Only one question: do you want to match field from search 2 with only one field from search_1 or in all the _raw?&lt;/P&gt;&lt;P&gt;In the second case you can use the following search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search_1 [ search your_search_2 | rename field_2 AS query | fields query ]
| ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;in the first case (if field_1 is the field in the search_1 and field_2 is the field in search_2), try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search_1 [ search your_search_2 | eval field_1="*".field_2."*" | fields field_1 ]
| ...&lt;/LI-CODE&gt;&lt;P&gt;In this second case the fields in main search and subsearch must have the same name (case sensitive).&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 17 Nov 2020 11:27:54 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2020-11-17T11:27:54Z</dc:date>
    <item>
      <title>How to search a field which contain text from another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-field-which-contain-text-from-another-field/m-p/529723#M149634</link>
      <description>&lt;P&gt;Hey, i want to search a field and get all the results which &lt;FONT face="tahoma,arial,helvetica,sans-serif" color="#FF0000"&gt;&lt;STRONG&gt;contain a&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;value &lt;/STRONG&gt;&lt;/FONT&gt;from another field.&lt;/P&gt;&lt;P&gt;For example:&amp;nbsp; I have 2 fields: message and str.&lt;/P&gt;&lt;P&gt;I want to get all the logs which their message field contain the value of str field.&lt;/P&gt;&lt;P&gt;how can i do that?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 11:16:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-field-which-contain-text-from-another-field/m-p/529723#M149634</guid>
      <dc:creator>dordavid</dc:creator>
      <dc:date>2020-11-17T11:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a field which contain text from another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-field-which-contain-text-from-another-field/m-p/529725#M149635</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225056"&gt;@dordavid&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;you have two searches,&lt;/LI&gt;&lt;LI&gt;you want to filter the results of search_1 where a field of search_2 is present.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Only one question: do you want to match field from search 2 with only one field from search_1 or in all the _raw?&lt;/P&gt;&lt;P&gt;In the second case you can use the following search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search_1 [ search your_search_2 | rename field_2 AS query | fields query ]
| ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;in the first case (if field_1 is the field in the search_1 and field_2 is the field in search_2), try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search_1 [ search your_search_2 | eval field_1="*".field_2."*" | fields field_1 ]
| ...&lt;/LI-CODE&gt;&lt;P&gt;In this second case the fields in main search and subsearch must have the same name (case sensitive).&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 11:27:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-field-which-contain-text-from-another-field/m-p/529725#M149635</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-11-17T11:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a field which contain text from another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-field-which-contain-text-from-another-field/m-p/529731#M149638</link>
      <description>&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;i will give u an example:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;i have a two fields:&lt;BR /&gt;1) message&lt;BR /&gt;2) str&lt;/P&gt;&lt;P&gt;- lets assume that str contains the string&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;"high cpu".&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- i want to search all the logs which their&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;message field&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;contain the value of str:&amp;nbsp;all the logs which their message field contain "high cpu".&lt;/P&gt;&lt;P&gt;-i want to do it dynamically - something like that:&lt;BR /&gt;index = a | search message= {str}* //&amp;nbsp; all logs with message field which&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;U&gt;&lt;STRONG&gt;contain&lt;/STRONG&gt;&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;the content of str field&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 11:59:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-field-which-contain-text-from-another-field/m-p/529731#M149638</guid>
      <dc:creator>dordavid</dc:creator>
      <dc:date>2020-11-17T11:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a field which contain text from another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-field-which-contain-text-from-another-field/m-p/529739#M149642</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225056"&gt;@dordavid&lt;/a&gt;&amp;nbsp;... From the post -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247843" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/How-to-check-if-a-field-contains-a-value-of-another-field/m-p/247843&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;your search | eval result=if(like(field2,"%".field1."%"),"Contained","Not Contained")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;OR&lt;/P&gt;&lt;P&gt;| where match(field2,field1)&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 12:32:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-field-which-contain-text-from-another-field/m-p/529739#M149642</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-11-17T12:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a field which contain text from another field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-field-which-contain-text-from-another-field/m-p/529752#M149646</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225056"&gt;@dordavid&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;try my first solution or the solution by&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/80737"&gt;@inventsekar&lt;/a&gt;&amp;nbsp; that's equivalent.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 13:32:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-field-which-contain-text-from-another-field/m-p/529752#M149646</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-11-17T13:32:38Z</dc:date>
    </item>
  </channel>
</rss>

