Although the markets looked fine yesterday after the Federal Reserve raised its benchmark lending rate by three-quarters of a percentage point, it didn't take long for the panic to set back in. The Dow Jones Industrial Average lost more than 740 points today as investors digested the Fed's biggest hike since 1994 and turned their attention to the economic outlook.

The Dow closed the day below 30,000 for the first time in nearly a year and a half. Mortgage rates also soared higher, as investors grew more concerned about a potential recession and the magnitude of that recession.

The big losers on the day were American ExpressNike, and Caterpillar. While the majority of the Dow finished the day down, there were four stocks in the index that managed to survive the blood bath.

The 4 survivors

The big-box retailer Walmart (WMT 0.57%) finished the highest of any Dow stock, gaining just over 1% on the day. Over the last five days, Walmart has also managed to stay in the green despite very difficult trading conditions.

While we've heard large retailers talk about the shift away from discretionary goods in recent days, the consumer is still spending heavily on necessities such as groceries, which can greatly benefit Walmart, which now generates about 60% of its revenue from groceries.

Grocery stocks can do well in inflation because the stores can pass the higher costs onto the consumers. Walmart said earlier this year that it continues to take market share in the U.S. grocery category. The company grew grocery sales in the low double-digit percentage range last quarter.

The consumer goods giant Procter & Gamble (PG -0.03%) also managed to scratch out a gain today, with shares up roughly 0.6%. 

With brands such as Pampers, Tide, Bounty, and Gillette, among many other cosmetics and household brands, it made sense that investors shifted over to a stock like Procter & Gamble today. When there are concerns over a recession and rates are on the rise, the market will look less favorably on tech and growth stocks because they are riskier. In addition, higher rates reduce the value of their future cash flows, as well as their earnings power.

But people are still going to need paper towels, diapers, and shaving equipment during a recession, making this stock more recession-proof than others. The other two stocks that eked out a gain today were Merck and Johnson & Johnson.

Should you pile into these names?

I definitely don't hate the idea of adding some of these more recession-proof names like Walmart or Procter & Gamble to your portfolio because people are always going to need these products, making these companies potentially more durable during the volatility.

But that doesn't mean I wouldn't also take this sell-off as an opportunity to go bargain hunting. If a recession occurs, it could end up being a mild one and recessions don't always last that long either. When looking for discounts, take a long view and focus on the business model as opposed to near-term price action.