<?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: Adding of value in splunk number string in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Adding-of-value-in-splunk-number-string/m-p/696210#M236623</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;Actually there is a lookup From which I want to extract such kind of pattern.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;yesterday I performed so many hit and trial and finally the below one is working as expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;| input lookup dsa.csv&lt;BR /&gt;| eval parts = split(Description, ".")&lt;BR /&gt;| eval part1 = mvindex(parts, 0)&lt;BR /&gt;| eval part2 = mvindex(parts, 1)&lt;BR /&gt;| eval part3 = mvindex(parts, 2)&lt;BR /&gt;| eval modified_part2= if(len(part2) == 1, "0" . part2, part2)&lt;BR /&gt;| eval modified_part3 = if(len(part3) == 1, "0" . part3, part3)&lt;BR /&gt;| eval modified_description = part1 . "." . modified_part2 . "." . modified_part3&lt;BR /&gt;| table Description, modified_description&lt;/P&gt;</description>
    <pubDate>Wed, 14 Aug 2024 03:09:44 GMT</pubDate>
    <dc:creator>uagraw01</dc:creator>
    <dc:date>2024-08-14T03:09:44Z</dc:date>
    <item>
      <title>Adding of value in splunk number string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-of-value-in-splunk-number-string/m-p/696145#M236614</link>
      <description>&lt;P&gt;Hello Splunkers!!&lt;/P&gt;&lt;P&gt;I want to achieve below results in Splunk. Please help me how to achieve this in SPL. Whenever the field is carrying number string then I want below expected results.&lt;/P&gt;&lt;TABLE width="199"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="93"&gt;&lt;STRONG&gt;Current results&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="106"&gt;&lt;STRONG&gt;Expected values&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1102.1.1&lt;/TD&gt;&lt;TD&gt;1102.01.01&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1102.1.2&lt;/TD&gt;&lt;TD&gt;1102.01.02&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="uagraw01_0-1723561909346.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32193iA521BA94F0081E34/image-size/medium?v=v2&amp;amp;px=400" role="button" title="uagraw01_0-1723561909346.png" alt="uagraw01_0-1723561909346.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2024 15:17:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-of-value-in-splunk-number-string/m-p/696145#M236614</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2024-08-13T15:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adding of value in splunk number string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-of-value-in-splunk-number-string/m-p/696203#M236619</link>
      <description>&lt;P&gt;How are you getting your current results - what's your existing SPL?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2024 23:26:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-of-value-in-splunk-number-string/m-p/696203#M236619</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-08-13T23:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Adding of value in splunk number string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-of-value-in-splunk-number-string/m-p/696210#M236623</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;Actually there is a lookup From which I want to extract such kind of pattern.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;yesterday I performed so many hit and trial and finally the below one is working as expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;| input lookup dsa.csv&lt;BR /&gt;| eval parts = split(Description, ".")&lt;BR /&gt;| eval part1 = mvindex(parts, 0)&lt;BR /&gt;| eval part2 = mvindex(parts, 1)&lt;BR /&gt;| eval part3 = mvindex(parts, 2)&lt;BR /&gt;| eval modified_part2= if(len(part2) == 1, "0" . part2, part2)&lt;BR /&gt;| eval modified_part3 = if(len(part3) == 1, "0" . part3, part3)&lt;BR /&gt;| eval modified_description = part1 . "." . modified_part2 . "." . modified_part3&lt;BR /&gt;| table Description, modified_description&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2024 03:09:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-of-value-in-splunk-number-string/m-p/696210#M236623</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2024-08-14T03:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Adding of value in splunk number string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-of-value-in-splunk-number-string/m-p/696216#M236627</link>
      <description>&lt;P&gt;This might be easier&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval modified_description = mvjoin(split(Description, "."), ".0")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an emulation of your mock data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv = data="Description
Aisle 1014
Aisle 1015
1102.1.1
1102.1.2"
```
the above emulates
| input lookup dsa.csv
```&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this, the output is&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Description&lt;/TD&gt;&lt;TD&gt;modified_description&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Aisle 1014&lt;/TD&gt;&lt;TD&gt;Aisle 1014&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Aisle 1015&lt;/TD&gt;&lt;TD&gt;Aisle 1015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1102.1.1&lt;/TD&gt;&lt;TD&gt;1102.01.01&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1102.1.2&lt;/TD&gt;&lt;TD&gt;1102.01.02&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 14 Aug 2024 04:17:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-of-value-in-splunk-number-string/m-p/696216#M236627</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-08-14T04:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adding of value in splunk number string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-of-value-in-splunk-number-string/m-p/696535#M236721</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp; This also working fine. Thanks for your suggestion.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2024 18:57:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-of-value-in-splunk-number-string/m-p/696535#M236721</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2024-08-16T18:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Adding of value in splunk number string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-of-value-in-splunk-number-string/m-p/696537#M236722</link>
      <description>&lt;P&gt;That's one way to do it.&lt;/P&gt;&lt;P&gt;Judging from your working code you want to replace the single digit with 0&amp;lt;digit&amp;gt; in any of those two fields, not just when both parts are short (which was suggested by your initial sample).&lt;/P&gt;&lt;P&gt;You can just do it with&lt;/P&gt;&lt;PRE&gt;| input lookup dsa.csv&lt;BR /&gt;| rex mode=sed field=Description "s/\b\d\b/0&amp;amp;/g"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2024 19:24:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-of-value-in-splunk-number-string/m-p/696537#M236722</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-08-16T19:24:21Z</dc:date>
    </item>
  </channel>
</rss>

