<?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: replace values within a chart command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410143#M118329</link>
    <description>&lt;P&gt;Try these&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindexname sourcetype=sourcetype Group="pw-pro*" 
|chart count by User Group limit=0
| replace "0" with "N" "1" with "Y" in PW*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR (if above doesn't work, use the foreach as-is, &lt;CODE&gt;&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;&lt;/CODE&gt; has to be use literally the way specified below)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindexname sourcetype=sourcetype Group="pw-pro*" 
|chart count by User Group limit=0
| foreach PW* [| eval "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"=if('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'=0,"N","Y")]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 24 May 2018 19:19:11 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-05-24T19:19:11Z</dc:date>
    <item>
      <title>replace values within a chart command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410140#M118326</link>
      <description>&lt;P&gt;I have a search that looks at a index that has the user and a single group they belong to as shown below: I then use a chart command [index=myindexname sourcetype=sourcetype Group="pw-pro*" |chart count by User Group limit=0]  to give me a two dimensional chart as shown below: by using the count parameter I either get a value of zero or one since all names are unique. zero represents that the user is not part of that group and a count of one means they are present in the group. so here's the question for readability I want to replace the zero with either a "N" or Space and the "1's with "Y" nothing I have tried works. I tried using a eval with a if command and or a case command and I even tried using a replace command none of them worked. How do I accomplish this?&lt;/P&gt;

&lt;P&gt;DATA:&lt;BR /&gt;
USER-1; PW-PRO-ROLE2&lt;BR /&gt;
USER-1; PW-PRO-ROLE5&lt;BR /&gt;
USER-2; PW-PRO-ROLE3&lt;BR /&gt;
USER-3; PW-PRO-ROLE1&lt;BR /&gt;
USER-4; PW-PRO-ROLE3&lt;BR /&gt;
USER-4; PW-PRO-ROLE4&lt;BR /&gt;
USER-5; PW-PRO-ROLE2&lt;BR /&gt;
USER-6; PW-PRO-ROLE2&lt;BR /&gt;
USER-6; PW-PRO-ROLE4&lt;/P&gt;

&lt;P&gt;SEARCH/CHART Results&lt;BR /&gt;
User    PW-PRO-ROLE1    PW-PRO-ROLE2    PW-PRO-ROLE3    PW-PRO-ROLE4    PW-PRO-ROLE5&lt;BR /&gt;
USER-1  0   1   0   0   1&lt;BR /&gt;
USER-2  0   0   1   0   0&lt;BR /&gt;
USER-3  1   0   0   0   0&lt;BR /&gt;
USER-4  0   0   1   1   0&lt;BR /&gt;
USER-5  0   1   0   0   0&lt;BR /&gt;
USER-6  0   1   0   1   0&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 17:48:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410140#M118326</guid>
      <dc:creator>bsstewart</dc:creator>
      <dc:date>2018-05-24T17:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: replace values within a chart command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410141#M118327</link>
      <description>&lt;P&gt;@bsstewart, please try the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindexname sourcetype=sourcetype Group="pw-pro*" 
| stats count by  User Group
| eval Flag=case(count=1,"Yes")
| chart values(Flag) by User Group limit=0
| fillnull value="No"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 May 2018 18:44:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410141#M118327</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-24T18:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: replace values within a chart command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410142#M118328</link>
      <description>&lt;P&gt;I tried your answer the result is the same still has 0's and 1's ?&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 19:12:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410142#M118328</guid>
      <dc:creator>bsstewart</dc:creator>
      <dc:date>2018-05-24T19:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: replace values within a chart command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410143#M118329</link>
      <description>&lt;P&gt;Try these&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindexname sourcetype=sourcetype Group="pw-pro*" 
|chart count by User Group limit=0
| replace "0" with "N" "1" with "Y" in PW*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR (if above doesn't work, use the foreach as-is, &lt;CODE&gt;&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;&lt;/CODE&gt; has to be use literally the way specified below)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindexname sourcetype=sourcetype Group="pw-pro*" 
|chart count by User Group limit=0
| foreach PW* [| eval "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"=if('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'=0,"N","Y")]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 May 2018 19:19:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410143#M118329</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-24T19:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: replace values within a chart command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410144#M118330</link>
      <description>&lt;P&gt;@bsstewart, sorry I had missed &lt;CODE&gt;values(Flag)&lt;/CODE&gt; instead of replacing count. Can you please try again?&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 19:26:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410144#M118330</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-24T19:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: replace values within a chart command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410145#M118331</link>
      <description>&lt;P&gt;Thank you it worked! I appreciate the quick answer:)&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 16:37:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410145#M118331</guid>
      <dc:creator>bsstewart</dc:creator>
      <dc:date>2018-05-29T16:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: replace values within a chart command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410146#M118332</link>
      <description>&lt;P&gt;@bsstewart  Do accept the answer if your issue is resolved!&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 13:36:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/replace-values-within-a-chart-command/m-p/410146#M118332</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-30T13:36:26Z</dc:date>
    </item>
  </channel>
</rss>

