<?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 split multiple fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-fields/m-p/619049#M215153</link>
    <description>&lt;P&gt;Whereas you cannot do this in props.conf or transforms.conf, you don't necessarily have to write each split. &amp;nbsp;That's why SPL includes iteration commands such as &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Foreach" target="_blank" rel="noopener"&gt;foreach&lt;/A&gt;.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| foreach src_ip, user
  [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = split(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, "|#|")]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Nov 2022 06:16:21 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2022-11-01T06:16:21Z</dc:date>
    <item>
      <title>How to split multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-fields/m-p/619017#M215139</link>
      <description>&lt;P&gt;I need to be able to split multiple fields that have a delimiter of "|#|". The field name will differ depending on the log. Is there a way to do a mass split using props.conf or transforms.conf. Is there a way to do this without having to write a eval statement for every single field that may come?&lt;BR /&gt;&lt;BR /&gt;EX:&lt;BR /&gt;&lt;BR /&gt;log:: time=XXXX,src_ip="123.123.123.123|#|234.234.234.234|#|",user="foo1|#|foo2|#|foo3"......&lt;BR /&gt;&lt;BR /&gt;I want to split src_ip, and user.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 21:27:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-fields/m-p/619017#M215139</guid>
      <dc:creator>paras</dc:creator>
      <dc:date>2022-10-31T21:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-fields/m-p/619024#M215142</link>
      <description>&lt;P&gt;Use the &lt;FONT face="courier new,courier"&gt;split&lt;/FONT&gt; function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval src_ip="123.123.123.123|#|234.234.234.234|#|",user="foo1|#|foo2|#|foo3"
| eval srcs=split(src_ip, "|#|"), users=split(user,"|#|")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can do it at index time using INGEST_EVAL.&amp;nbsp; In transforms.conf:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;INGEST_EVAL srcs=split(src_ip, "|#|")
INGEST_EVAL users=split(user,"|#|")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 01 Nov 2022 12:58:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-fields/m-p/619024#M215142</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-11-01T12:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to split multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-fields/m-p/619049#M215153</link>
      <description>&lt;P&gt;Whereas you cannot do this in props.conf or transforms.conf, you don't necessarily have to write each split. &amp;nbsp;That's why SPL includes iteration commands such as &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Foreach" target="_blank" rel="noopener"&gt;foreach&lt;/A&gt;.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| foreach src_ip, user
  [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = split(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, "|#|")]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 06:16:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-multiple-fields/m-p/619049#M215153</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-11-01T06:16:21Z</dc:date>
    </item>
  </channel>
</rss>

