<?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: Ignore field when searching for arbitrary string(s) but still return its results. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745734#M241529</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/224337"&gt;@shawngsharp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I think I know what you're looking for - you dont want it to match if *only* my_field_42 contains the string? So it must be in one of the other fields?&lt;/P&gt;&lt;P&gt;You could try this - Im not sure how performant it will be at scale but working for me:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=YourIndex *widget*
| tojson 
| eval orig_field_42=json_extract(_raw,"my_field_42") 
| eval _raw=json_delete(_raw,"my_field_42") 
| search *widget* 
| eval _raw=json_set(_raw,"my_field_42",orig_field_42)&lt;/LI-CODE&gt;&lt;P&gt;This works by temporarily removing the my_field_42 from the results before applying a secondary search - Ive gone with "tojson" which converts all the fields into json object in _raw.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is a sample query if it helps:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livehybrid_0-1746654943874.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38901i4F401CE28EE180F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livehybrid_0-1746654943874.png" alt="livehybrid_0-1746654943874.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|makeresults format=csv data="my_field1, my_field_2, my_field_23, my_field_42
\"hello world\",\"AwesomeWidget69\",\"\",\"your mom\"
\"hello world\",\"\",\"Widgets are cool\",\"Look, a widget!\"
\"hello world\",\"\",\"Some value here\",\"your widget\""
| tojson 
| eval orig_field_42=json_extract(_raw,"my_field_42") 
| eval _raw=json_delete(_raw,"my_field_42") 
| search *widget*&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
    <pubDate>Wed, 07 May 2025 21:55:58 GMT</pubDate>
    <dc:creator>livehybrid</dc:creator>
    <dc:date>2025-05-07T21:55:58Z</dc:date>
    <item>
      <title>Ignore field when searching for arbitrary string(s) but still return its results.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745732#M241528</link>
      <description>&lt;P&gt;I am trying to do a query that will search for arbitrary strings, but will ignore if the string is/isn't in a specific field. I still want to see the results from that field, though.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index = my_index AND *widget*
| &amp;lt;ignore&amp;gt;  my_field_42&lt;/LI-CODE&gt;&lt;P&gt;Whether my_field_42 contains the word "widget" or not should not matter to the search, but it should still show it's field values in the results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result 1:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;my_field_1 = "hello world" 
my_field_2 = "AwesomeWidget69" 
...
my_field_42 = "your mom"&lt;/LI-CODE&gt;&lt;P&gt;Result 2:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;my_field_1 = "hello world" 
my_field_23 = "Widgets are cool" 
...
my_field_42 = "Look, a widget!"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 21:24:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745732#M241528</guid>
      <dc:creator>shawngsharp</dc:creator>
      <dc:date>2025-05-07T21:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore field when searching for arbitrary string(s) but still return its results.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745734#M241529</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/224337"&gt;@shawngsharp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I think I know what you're looking for - you dont want it to match if *only* my_field_42 contains the string? So it must be in one of the other fields?&lt;/P&gt;&lt;P&gt;You could try this - Im not sure how performant it will be at scale but working for me:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=YourIndex *widget*
| tojson 
| eval orig_field_42=json_extract(_raw,"my_field_42") 
| eval _raw=json_delete(_raw,"my_field_42") 
| search *widget* 
| eval _raw=json_set(_raw,"my_field_42",orig_field_42)&lt;/LI-CODE&gt;&lt;P&gt;This works by temporarily removing the my_field_42 from the results before applying a secondary search - Ive gone with "tojson" which converts all the fields into json object in _raw.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is a sample query if it helps:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livehybrid_0-1746654943874.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38901i4F401CE28EE180F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livehybrid_0-1746654943874.png" alt="livehybrid_0-1746654943874.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|makeresults format=csv data="my_field1, my_field_2, my_field_23, my_field_42
\"hello world\",\"AwesomeWidget69\",\"\",\"your mom\"
\"hello world\",\"\",\"Widgets are cool\",\"Look, a widget!\"
\"hello world\",\"\",\"Some value here\",\"your widget\""
| tojson 
| eval orig_field_42=json_extract(_raw,"my_field_42") 
| eval _raw=json_delete(_raw,"my_field_42") 
| search *widget*&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 21:55:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745734#M241529</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-05-07T21:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore field when searching for arbitrary string(s) but still return its results.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745736#M241530</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/224337"&gt;@shawngsharp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Further to my last post, you could also use:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|foreach * [eval field_matches = mvappend(field_matches, if(match(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, "(?i)widget"), "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;", null()))]
| eval field_matches=mvfilter(NOT match(field_matches,"my_field_42"))
| where field_matches!=""&lt;/LI-CODE&gt;&lt;P&gt;Where your string match is inside the match statement, this works by looking in each field and then creating a multi-value field of all the fields which match, then removing my_field_42 and searching where there is one or more fields that match.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="livehybrid_0-1746655477684.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/38902iB6B77E8ED73190D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="livehybrid_0-1746655477684.png" alt="livehybrid_0-1746655477684.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|makeresults format=csv data="my_field1, my_field_2, my_field_23, my_field_42
\"hello world\",\"AwesomeWidget69\",\"\",\"your mom\"
\"hello world\",\"\",\"Widgets are cool\",\"Look, a widget!\"
\"hello world\",\"\",\"Some value here\",\"your widget\""
|foreach * [eval field_matches = mvappend(field_matches, if(match(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, "(?i)widget"), "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;", null()))]
| eval field_matches=mvfilter(NOT match(field_matches,"my_field_42"))
| where field_matches!=""&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 22:04:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745736#M241530</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-05-07T22:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore field when searching for arbitrary string(s) but still return its results.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745740#M241532</link>
      <description>&lt;P&gt;What should happen if the data is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;my_field_1 = "hello world" 
my_field_23 = "goodbye my friend" 
...
my_field_42 = "Look, a widget!"&lt;/LI-CODE&gt;&lt;P&gt;i.e. widget ONLY appears in the field you want to ignore&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 01:32:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745740#M241532</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2025-05-08T01:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore field when searching for arbitrary string(s) but still return its results.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745742#M241533</link>
      <description>&lt;P&gt;I would go with foreach as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170906"&gt;@livehybrid&lt;/a&gt;&amp;nbsp;does, but the code could be simpler.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|foreach *
  [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = if(match(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, "(?i)widget") OR "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;" == "my_field_42", &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, null())]&lt;/LI-CODE&gt;&lt;P&gt;Using the same emulation, you get&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;my_field1&lt;/TD&gt;&lt;TD&gt;my_field_2&lt;/TD&gt;&lt;TD&gt;my_field_23&lt;/TD&gt;&lt;TD&gt;my_field_42&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="62.609375px" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="152.3125px" height="25px"&gt;AwesomeWidget69&lt;/TD&gt;&lt;TD width="131.359375px" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="118.8125px" height="25px"&gt;your mom&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="62.609375px" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="152.3125px" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="131.359375px" height="25px"&gt;Widgets are cool&lt;/TD&gt;&lt;TD width="118.8125px" height="25px"&gt;Look, a widget!&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="62.609375px" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="152.3125px" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="131.359375px" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="118.8125px" height="25px"&gt;your widget&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 08 May 2025 03:40:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745742#M241533</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2025-05-08T03:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore field when searching for arbitrary string(s) but still return its results.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745853#M241554</link>
      <description>&lt;P&gt;Great question! In that case, it shouldn't return the result(s).&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2025 15:21:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745853#M241554</guid>
      <dc:creator>shawngsharp</dc:creator>
      <dc:date>2025-05-09T15:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore field when searching for arbitrary string(s) but still return its results.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745865#M241559</link>
      <description>&lt;P&gt;As I love border cases I'm wondering if&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170906"&gt;@livehybrid&lt;/a&gt;&amp;nbsp;'s solutions handle properly the situation where not all event is parsed into events. In this case you cannot simply iterate over all extracted fields because the string may be contained within a part of the _raw event which is not extracted. So if you only manipulate fields, you won't catch it.&lt;/P&gt;&lt;P&gt;Another thing to consider - automatic lookups and calculated fields.&lt;/P&gt;&lt;P&gt;Nobody said it would be easy &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2025 18:26:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Ignore-field-when-searching-for-arbitrary-string-s-but-still/m-p/745865#M241559</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-05-09T18:26:56Z</dc:date>
    </item>
  </channel>
</rss>

